4

我的主要活动中有以下简单方法。

    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);  
    }

在我的清单中

<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" />

但是当我在模拟器中运行应用程序时,它崩溃了,根据日志,它说

  No activity found to handle the intent

有什么我做错了吗?

4

2 回答 2

6

模拟器设置中是否启用了地理定位?

于 2011-11-04T19:28:05.967 回答
3

好吧,地图应用程序没有安装在模拟器上,所以它给你的消息几乎解释了这个问题。模拟器上没有任何设置来处理这种意图......

于 2011-11-04T19:35:49.107 回答