安卓系统:街景意图导致ActivityNotFoundException



我正试图将streeview添加到我的android应用程序中,但我一直收到以下异常。

01-06 18:35:35.810: E/AndroidRuntime(2497): FATAL EXCEPTION: main
01-06 18:35:35.810: E/AndroidRuntime(2497): java.lang.RuntimeException: Unable to start activity ComponentInfo{glasgo.activities/glasgo.activities.specific_event_activity$MapTab}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=google.streetview:cbll=55867650,-4257630&cbp=1,180,,0,1.0 }
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1768)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:1598)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:654)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.widget.TabHost.setCurrentTab(TabHost.java:326)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:132)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:455)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.view.View.performClick(View.java:2502)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.view.View$PerformClick.run(View.java:9108)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.os.Handler.handleCallback(Handler.java:587)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.os.Handler.dispatchMessage(Handler.java:92)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.os.Looper.loop(Looper.java:130)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.ActivityThread.main(ActivityThread.java:3835)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at java.lang.reflect.Method.invokeNative(Native Method)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at java.lang.reflect.Method.invoke(Method.java:507)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at dalvik.system.NativeStart.main(Native Method)
01-06 18:35:35.810: E/AndroidRuntime(2497): Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=google.streetview:cbll=55867650,-4257630&cbp=1,180,,0,1.0 }
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1409)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.Activity.startActivityFromChild(Activity.java:3067)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.Activity.startActivityForResult(Activity.java:2847)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.Activity.startActivity(Activity.java:2933)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at glasgo.activities.specific_event_activity$MapTab.onCreate(specific_event_activity.java:169)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-06 18:35:35.810: E/AndroidRuntime(2497):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)

我使用的是GreenDroid库,我的地图视图在一个静态类中,GreenDroid需要该类才能使用它的选项卡。

    public static class MapTab extends MapActivity {
    private MapController controller;
    private MapView mapView; 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // code to get a map with zoom controls and double tap support
        setContentView(R.layout.map_with_zomm_and_tap);
        mapView = (MapView) findViewById(R.id.mapview);
        controller = mapView.getController();
        // some other code which runs fine
        Intent streetViewIntent = new Intent(Intent.ACTION_VIEW, Uri.parse 
                     ("google.streetview:cbll=55867650,-4257630&cbp=1,180,,0,1.0")); 
        startActivity(streetViewIntent); 
        }

我目前只是想让它显示街道视图,然后我会创建一个按钮在街道视图和普通地图视图之间切换。

我有一个地图键,可以在我添加的清单中显示应用程序中的正常地图视图使用库android:name="com.google.android.maps"

如有任何帮助,我们将不胜感激。

原来是因为设备或模拟器上没有安装StreetView。

相关内容

  • 没有找到相关文章

最新更新