Я вроде застрял с этой проблемой на Android.Я создал приложение API карт с пользовательским наложением, и каждый раз, когда я пытаюсь щелкнуть наложение и запустить намерение (карты Google), происходит сбой:
возможно соответствующий код:
threadid=3: thread exiting with uncaught exception (group=0x4001b188)
Uncaught handler: thread main exiting due to uncaught exception
java.lang.NullPointerException
at android.app.Activity.startActivityForResult(Activity.java:2749)
at android.app.Activity.startActivity(Activity.java:2855)
at com.jcfrei.chparking.funtionality.startgmapsnav(funtionality.java:16)
at com.jcfrei.chparking.ParkingOverlay.onTap(ParkingOverlay.java:91)
at com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:453)
at com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)
at com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:346)
at android.view.GestureDetector.onTouchEvent(GestureDetector.java:506)
at com.google.android.maps.MapView.onTouchEvent(MapView.java:628)
at android.view.View.dispatchTouchEvent(View.java:3709)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:852)
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)
и
public class funtionality extends Activity {
public void startgmapsnav (String lat, String lon) {
Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:38.899533,-77.036476"));
startActivity(myIntent);
}
}
внутри оверлея
@Override
protected boolean onTap(int index) {
//OverlayItem item = mOverlays.get(index);
funtionality lm = new funtionality();
lm.startgmapsnav(lat, lon);
return true;
}