菜单按钮强制关闭android?
当您打开菜单按钮并转到设置然后按后退按钮时,我的应用程序运行良好,但是当我将 Google 地图 API 添加到我的应用程序中时,后退按钮会强制关闭应用程序。还有其他人遇到同样的问题吗?如果是这样,你是如何解决的?或者有谁知道如何解决这个问题?
编辑:
我的日志猫错误后退按钮强制关闭
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): FATAL EXCEPTION: main
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): java.lang.RuntimeException: Unable to resume activity {www.Freshapp.com.Thumper.html/www.Freshapp.com.Thumper.html.Thumper}: java.lang.NullPointerException
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3128)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3143)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2059)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.os.Handler.dispatchMessage(Handler.java:99)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.os.Looper.loop(Looper.java:123)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.ActivityThread.main(ActivityThread.java:4627)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at java.lang.reflect.Method.invokeNative(Native Method)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at java.lang.reflect.Method.invoke(Method.java:521)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at dalvik.system.NativeStart.main(Native Method)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): Caused by: java.lang.NullPointerException
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at com.google.android.maps.MapActivity.onResume(MapActivity.java:431)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at www.Freshapp.com.Thumper.html.Thumper.onResume(Thumper.java:181)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.Activity.performResume(Activity.java:3823)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3118)
编辑2
我拿出了我的地图视图和地图视图所在的滑动抽屉以及与地图有关的所有内容并且应用程序没有获得 FC。
-谢谢
I have and application that worked fine when you opened the menu button and went to the settings then pushed the back button but when I added the Google maps API into my application the back button force closes the application. Has there been any one else with this same issue? If so how did you fix it? Or does anyone know how to fix this problem?
Edit:
My log cat errors on back button force close
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): FATAL EXCEPTION: main
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): java.lang.RuntimeException: Unable to resume activity {www.Freshapp.com.Thumper.html/www.Freshapp.com.Thumper.html.Thumper}: java.lang.NullPointerException
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3128)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3143)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2059)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.os.Handler.dispatchMessage(Handler.java:99)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.os.Looper.loop(Looper.java:123)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.ActivityThread.main(ActivityThread.java:4627)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at java.lang.reflect.Method.invokeNative(Native Method)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at java.lang.reflect.Method.invoke(Method.java:521)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at dalvik.system.NativeStart.main(Native Method)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): Caused by: java.lang.NullPointerException
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at com.google.android.maps.MapActivity.onResume(MapActivity.java:431)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at www.Freshapp.com.Thumper.html.Thumper.onResume(Thumper.java:181)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.Activity.performResume(Activity.java:3823)
04-29 16:02:13.155: ERROR/AndroidRuntime(16828): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3118)
Edit 2
I took out my map view and the sliding drawer that the map view was in and everything to do with the map and the application gets no FC.
-Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了,我只需要在我的设置中添加一个后退按钮功能即可。现在效果很好
I figured it out, I just needed to add a back button function inside of my Setting. Works great now