I am trying to open Gogole Maps to a specific location with the below code, however the app is crashing with the error “No Activity Found to Handle Intent”. Can anyone see what the problem is ?
ImageButton addressbutton = (ImageButton) findViewById(R.id.addressbutton);
addressbutton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
String uri = "geo:0,0?q=MCNAMARA+TERMINAL+ROMULUS+MI+48174";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(uri));
startActivity(i);
}
});
The code works fine. The problem is the device/emulator you are testing the code at.
If you use AVD having Google APIs target (any level since 3), it works as expected. However, if you use AVD having normal Android target (that’s a target without maps support), you get the error.