I am trying to get google maps to zoom to the location of the device being used.
google maps is launched from inside my application via an intent the code is below.
button_bakery = (Button) findViewById(R.id.Breakfast_bakery);
button_bakery.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View views) {
Button b = button_bakery;
String buttonText = b.getText().toString();
// Search for restaurants nearby
Uri gmmIntentUri = Uri.parse("geo:0,0?q=" + buttonText);
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
}
}
);
however this loads the location as the last location set by the device when using this application. Is there a way to set it to zoom to the current location of the device before the search is completed?
Thanks in advance!