Skip to content

Instantly share code, notes, and snippets.

@pratamawijaya
Created February 20, 2015 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pratamawijaya/3e926b6ad97277f7face to your computer and use it in GitHub Desktop.
Save pratamawijaya/3e926b6ad97277f7face to your computer and use it in GitHub Desktop.
@OnClick(R.id.btnGetRoute)
public void getRoute() {
if (!TextUtils.isEmpty(etFrom.getText())) {
Location loc = locations.get(spDestination.getSelectedItemPosition());
Bundle data = new Bundle();
data.putDouble("latAwal", lat);
data.putDouble("lngAwal", lng);
data.putDouble("latTujuan", loc.getLat());
data.putDouble("lngTujuan", loc.getLng());
data.putInt("status", MainActivity.FROM_NET);
data.putString("tujuan", loc.getName());
startActivity(new Intent(this, ViewRouteActivity.class).putExtras(data));
} else {
Toast.makeText(this, "can't empty", Toast.LENGTH_SHORT).show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment