No actions were found to handle location targeting in the emulator

I have a simple method in my main activity.

private void showMap(String name ) { String thePlace = name.replaceAll(" ", "+"); Intent intent= new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + thePlace+ "" )); startActivity(intent); } 

And in my manifest

 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.INTERNET" /> 

But when I run the application in the emulator, it crashed and, according to the log, says

  No activity found to handle the intent 

Is there something I'm doing wrong?

+4
source share
2 answers

Is geolocation enabled in the emulator settings?

+6
source

Well, the Maps app is not installed on the emulator, so the message it gives you largely explains the problem. There is no setting on the emulator to handle this intention ...

+3
source

Source: https://habr.com/ru/post/1379704/


All Articles