My android application is calling Google Maps (using ACTION_VIEW) from my first activity.
public void goToMap(View v)
{
Toast.makeText(this,"Button is clicked",Toast.LENGTH_SHORT).show();
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("geo:23.214889,77.3988962"));
intent.putExtra("Id", "map");
startActivity(intent);
}
Documentation to use GoogleMap object with OnMapClickListener is nowhere specified.
What i am trying is:
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
GoogleMap map;
// Here--------------------------------------------
// What object should this map object be and how should i use this.
map.setOnMapClickListener(new OnMapClickListener() {
@Override
public void onMapClick(LatLng point) {
// TODO Auto-generated method stub
double lat = point.latitude;
double lng = point.longitude;
}
});
return true;
}
I haven't assigned an ID to the intent i am starting.
I want to use onMapClick() function for my GOOGLE MAP TOUCH EVENT. How to initialise the map object so that it can be used for click Listener event.
Please guide me through this.
Thanks.