#install
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
#install
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
##URL FORMAT:
http://maps.googleapis.com/maps/api/directions/json?origin=" + lat1 + "," + lon1 + "&destination=" + lat2 + "," + lon2 + "&sensor=false&units=metric&mode=driving
##URL example:
http://maps.googleapis.com/maps/api/directions/json?origin=-7.0753592,110.3586899&destination=-7.1206129,110.4038428&sensor=false&units=metric&mode=driving
##JSON response with GET Request:
import java.text.DateFormat; | |
import java.text.DecimalFormat; | |
import java.text.DecimalFormatSymbols; | |
import java.text.SimpleDateFormat; | |
/** | |
* convert string to currency format | |
* @param value money | |
* @return |
/** | |
* untuk mencari posisi item pada listview | |
* @param position : posisi item pada listview | |
* @param listView : listview | |
* @return View posisi item | |
*/ | |
public static View getViewByPosition(int position, ListView listView) { | |
final int firstListItemPosition = listView.getFirstVisiblePosition(); | |
final int lastListItemPosition = firstListItemPosition |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentPagerAdapter; | |
/** | |
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to | |
* one of the sections/tabs/pages. | |
*/ | |
public class TabFragmentAdapter extends FragmentPagerAdapter { |
/** | |
* Copyright (C) 2016 hendrawd | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
<stroke | |
android:color="@color/color_primary" | |
android:width="5dp" /> | |
<stroke | |
android:width="5dp" | |
android:color="@color/black"/> | |
<corners |
final Intent intentGmail = new Intent(Intent.ACTION_VIEW); | |
intentGmail.setClassName("com.google.android.gm","com.google.android.gm.ComposeActivityGmail"); | |
intentGmail.putExtra(Intent.EXTRA_EMAIL, new String[] { "user@email.com" }); | |
intentGmail.putExtra(Intent.EXTRA_SUBJECT, "SUBJECT EMAIL"); | |
intentGmail.setType("plain/text"); | |
intentGmail.putExtra(Intent.EXTRA_TEXT, "message email is here.." | |
); | |
try { | |
startActivity(intentGmail); |