ActivityNotFoundException while trying to start map activity

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

ActivityNotFoundException while trying to start map activity

Postby HaitiBoy » Thu Jun 24, 2010 2:36 pm

I try to launch google maps when user clicks on the textview using Linkify
Here is how I do it:
Code: Select all
      TextView address = new TextView(this);
      address.setText("25 Street, Detroit, MI");
      Linkify.addLinks(address, Linkify.MAP_ADDRESSES);

and i am getting Activity not found exception.

Any ideas why am i getting this? Do I have to declare Map Activity?
Any help is appreciated, thanks
HaitiBoy
Freshman
Freshman
 
Posts: 6
Joined: Fri Jun 18, 2010 6:35 pm
Location: Houghton, Michigan

Top

Re: ActivityNotFoundException while trying to start map acti

Postby mathias.lin » Thu Jun 24, 2010 5:38 pm

You should post the whole stacktrace, that would be easier to find the problem then and which activity the app is trying to launch actually.
User avatar
mathias.lin
Experienced Developer
Experienced Developer
 
Posts: 60
Joined: Tue Aug 11, 2009 4:21 am
Location: Guangzhou, China

Re: ActivityNotFoundException while trying to start map acti

Postby HaitiBoy » Thu Jun 24, 2010 5:56 pm

Code: Select all
Uncaught handler: thread main exiting due to uncaught exception
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=geo:0,0?q=100+Shelden+Ave.%2C+Detroit%2C+MI (has extras) }
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
    at android.app.Activity.startActivityForResult(Activity.java:2749)
    at android.app.Activity.startActivity(Activity.java:2855)
    at android.text.style.URLSpan.onClick(URLSpan.java:62)
    at android.text.method.LinkMovementMethod.onTouchEvent(LinkMovementMethod.java:216)
    at android.widget.TextView.onTouchEvent(TextView.java:6561)
    at android.view.View.dispatchTouchEvent(View.java:3709)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
    at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
    at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.app.ActivityThread.main(ActivityThread.java:4363)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:521)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
    at dalvik.system.NativeStart.main(Native Method)


Thanks
HaitiBoy
Freshman
Freshman
 
Posts: 6
Joined: Fri Jun 18, 2010 6:35 pm
Location: Houghton, Michigan

Re: ActivityNotFoundException while trying to start map acti

Postby nex_otaku » Mon Nov 15, 2010 6:46 am

TextView has to be created in Activity context:

http://android.amberfog.com/?p=379
nex_otaku
Freshman
Freshman
 
Posts: 2
Joined: Thu Oct 14, 2010 9:14 pm

Re: ActivityNotFoundException while trying to start map acti

Postby pranav09 » Mon Nov 22, 2010 6:01 am

Is your class extends MapView? If your class extends Activity and if you are trying to display map, at this scenario, it will throw the exception. You should follow below steps to display map.

1. You should have google map api key.
2. Your class must extends MapActivity
3. Put the generated map-api-key in your main.xml file.
4. Put below permissions in your AndroidManifest.xml file.
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
5. Put <uses-library android:name="com.google.android.maps" /> in <application> tag.

Thanks.
Pranav
User avatar
pranav09
Senior Developer
Senior Developer
 
Posts: 128
Joined: Mon Jan 19, 2009 12:01 pm
Location: Ahmedabad, India

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 1 guest