google map v2 in android how to get current position and zoom in automatically and main countries selection point notification
setContentView(R.layout.activity_main);
try {
initilizeMap();
} catch (Exception e) {
e.printStackTrace();
}
}
@SuppressLint("NewApi")
private void initilizeMap() {
if (googleMap == null) {
googleMap = ((MapFragment) getFragmentManager().findFragmentById(
R.id.map)).getMap();
googleMap.animateCamera(CameraUpdateFactory.zoomTo(5.0f));
LocationManager mlocManager =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);
googleMap.addMarker(new MarkerOptions()
.position(new LatLng(0, 0))
.title("Your Location is"));
if (googleMap == null) {
Toast.makeText(getApplicationContext(),
"Sorry! unable to create maps", Toast.LENGTH_SHORT)
.show();
}
}
}
protected void onResume() {
super.onResume();
initilizeMap();
}