Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>here maybe you can use something like this</p> <pre><code>public class showroommap extends Activity implements OnMarkerClickListener{ static final LatLng HAMBURG = new LatLng(53.558, 9.927); static final LatLng KIEL = new LatLng(52.633011,-1.132913); private GoogleMap map; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.showroommap); map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)) .getMap(); Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG) .title("Hamburg")); Marker kiel = map.addMarker(new MarkerOptions() .position(KIEL) .title("Kiel") .snippet("Kiel is cool") .icon(BitmapDescriptorFactory .fromResource(R.drawable.ic_launcher))); map.setOnMarkerClickListener(this); //Move the camera instantly to hamburg with a zoom of 15. map.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15)); //Zoom in, animating the camera. map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } } @Override public boolean onMarkerClick(Marker arg0) { final Context mContext = this; final LatLng now = arg0.getPosition(); AlertDialog.Builder course = new AlertDialog.Builder(mContext); course.setNegativeButton("On Foot", new OnClickListener(){ @Override public void onClick(DialogInterface arg0, int arg1) { // TODO Auto-generated method stub Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("google.navigation:ll=%s,%s%s", now.latitude, now.longitude, "&amp;mode=w"))); mContext.startActivity(i); } }); course.setNeutralButton("By Car", new OnClickListener(){ @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("google.navigation:ll=%s,%s%s", now.latitude, now.longitude, "&amp;mode=d"))); mContext.startActivity(i); } }); course.setPositiveButton("On Bike", new OnClickListener(){ @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("google.navigation:ll=%s,%s%s", now.latitude, now.longitude, "&amp;mode=b"))); mContext.startActivity(i); } }); course.show(); return false; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload