gpt4 book ai didi

android - Hello Google Maps 示例 NULL 指针异常

转载 作者:行者123 更新时间:2023-11-29 18:15:13 26 4
gpt4 key购买 nike

我正在为 android 创建一个谷歌地图应用程序,我正在按照 http://developer.android.com/resources/tutorials/views/hello-mapview.html 上的指南进行操作开始。

我可以在我的模拟器中很好地运行该应用程序,但是当我单击叠加项时,我得到一个 NULL 指针异常。踪迹如下。我是 Android 的新手,不知道如何调试它。因此,我们将不胜感激任何帮助。

12-20 02:57:05.898: W/dalvikvm(473): threadid=1: thread exiting with uncaught exception (group=0x40015560)
12-20 02:57:05.928: E/AndroidRuntime(473): FATAL EXCEPTION: main
12-20 02:57:05.928: E/AndroidRuntime(473): java.lang.NullPointerException
12-20 02:57:05.928: E/AndroidRuntime(473): at com.android.internal.app.AlertController$AlertParams.<init>(AlertController.java:742)
12-20 02:57:05.928: E/AndroidRuntime(473): at android.app.AlertDialog$Builder.<init>(AlertDialog.java:273)
12-20 02:57:05.928: E/AndroidRuntime(473): at hello.google.maps.HelloItemizedOverlay.onTap(HelloItemizedOverlay.java:41)
12-20 02:57:05.928: E/AndroidRuntime(473): at com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:453)
12-20 02:57:05.928: E/AndroidRuntime(473): at com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)
12-20 02:57:05.928: E/AndroidRuntime(473): at com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:356)
12-20 02:57:05.928: E/AndroidRuntime(473): at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:533)
12-20 02:57:05.928: E/AndroidRuntime(473): at com.google.android.maps.MapView.onTouchEvent(MapView.java:683)
12-20 02:57:05.928: E/AndroidRuntime(473): at android.view.View.dispatchTouchEvent(View.java:3885)
12-20 02:57:05.928: E/AndroidRuntime(473): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
12-20 02:57:05.928: E/AndroidRuntime(473): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
12-20 02:57:05.928: E/AndroidRuntime(473): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
12-20 02:57:05.928: E/AndroidRuntime(473): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1691)
12-20 02:57:05.928: E/AndroidRuntime(473): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1125)
12-20 02:57:05.928: E/AndroidRuntime(473): at android.app.Activity.dispatchTouchEvent(Activity.java:2096)
12-20 02:57:05.928: E/AndroidRuntime(473): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1675)
12-20 02:57:05.928: E/AndroidRuntime(473): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2194)
12-20 02:57:05.928: E/AndroidRuntime(473): at android.view.ViewRoot.handleMessage(ViewRoot.java:1878)
12-20 02:57:05.928: E/AndroidRuntime(473): at android.os.Handler.dispatchMessage(Handler.java:99)
12-20 02:57:05.928: E/AndroidRuntime(473): at android.os.Looper.loop(Looper.java:130)
12-20 02:57:05.928: E/AndroidRuntime(473): at android.app.ActivityThread.main(ActivityThread.java:3683)
12-20 02:57:05.928: E/AndroidRuntime(473): at java.lang.reflect.Method.invokeNative(Native Method)
12-20 02:57:05.928: E/AndroidRuntime(473): at java.lang.reflect.Method.invoke(Method.java:507)
12-20 02:57:05.928: E/AndroidRuntime(473): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-20 02:57:05.928: E/AndroidRuntime(473): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-20 02:57:05.928: E/AndroidRuntime(473): at dalvik.system.NativeStart.main(Native Method)

谢谢!

最佳答案

关于android - Hello Google Maps 示例 NULL 指针异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8572409/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com