question

tmg avatar image
tmg asked ·

com.amazon.geo.mapsv2.MapsActivity Intent Fails onInfoWindowClick

I am able to render a map within my application, but want to open the Amazon maps application onInfoWindowClick. My application raises this error. The onInfoWindowClick code is below. The code should work because it works correctly in a second application I created.

onInfoWindowClick error: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.amazon.geo.mapsv2/com.amazon.geo.mapsv2.MapsActivity}; have you declared this activity in your AndroidManifest.xml? at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1793) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1517) at android.app.Activity.startActivityForResult(Activity.java:3761) at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79) at android.support.v4.app.ActivityCompatJB.startActivityForResult(ActivityCompatJB.java:30) at android.support.v4.app.ActivityCompat.startActivityForResult(ActivityCompat.java:146) at android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:932) at android.support.v4.app.FragmentActivity$HostCallbacks.onStartActivityFromFragment(FragmentActivity.java:1047) at android.support.v4.app.Fragment.startActivity(Fragment.java:940) at android.support.v4.app.Fragment.startActivity(Fragment.java:929) at com.seguetech.tapfinder.fragments.LocationMapFragment.onInfoWindowClick(LocationMapFragment.java:251) at com.amazon.geo.mapsv2.AmazonMap$OnInfoWindowClickListenerDelegate.onInfoWindowClick(AmazonMap.java:1151) at com.amazon.geo.mapsv2.model.MarkerLayer$MarkerTapDelegate$2$1.run(MarkerLayer.java:611) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at com.amazon.client.framework.acf.HandlerComponent.dispatchMessage(HandlerComponent.java:149) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5484) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:984) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

@Override
public void onInfoWindowClick(Marker marker) {
   try {
      Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q="+marker.getPosition().latitude+","+marker.getPosition().longitude+" (" + URLEncoder.encode("Lost Dog Cafe: " + marker.getTitle(),"UTF-8") + ")"));
      intent.setClassName("com.amazon.geo.mapsv2", "com.amazon.geo.mapsv2.MapsActivity");
      startActivity(intent);
   }
   catch (Exception e) {
      Log.e(TAG,"onInfoWindowClick error: ",e);
   }
}
intentsamazon maps
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered ·

Hi tmg,

Thanks for posting! If this same code works in your other application, then you need to compare that you got the same code and the same relevant manifest sections in both of your apps. Also login to your Dev Portal account, and for this application check its corresponding entry in the Maps section. Thanks!

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.