bencallis
bencallis

Reputation: 3657

Android:StreetView intent causing ActivityNotFoundException

I am trying to add streeview to my android application but I keep getting the following exception.

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)

I am using the GreenDroid library and my map view is within a static class which GreenDroid requires for to use it's tabs.

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

I am currently just trying to make it display the street view and then I will create a button to toggle between street view and normal map view.

I have a map key and am able to display the normal map view in my application in my manifest I have added uses-library android:name="com.google.android.maps"

Any help would greatly be appreciated.

Upvotes: 0

Views: 1045

Answers (1)

bencallis
bencallis

Reputation: 3657

Turns out it was due to StreetView not being installed on the device or emulator.

Upvotes: 2

Related Questions