gpt4 book ai didi

android - 打开应用后,ANDROID应用会停止崩溃,以提供消息 “HAS STOPPED WORKING”

转载 作者:行者123 更新时间:2023-12-02 07:28:42 24 4
gpt4 key购买 nike

我尝试运行我的APP,最终收到一条消息“MegaVidi Stopped Working”,我尝试运行一些测试并得到以下错误

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.megatechnologyteam.megavidi/com.megatechnologyteam.megavidi.SplashActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.appcompat.app.ActionBar.hide()' on a null object reference
FATAL EXCEPTION: main
Process: com.megatechnologyteam.megavidi, PID: 10886
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.megatechnologyteam.megavidi/com.megatechnologyteam.megavidi.SplashActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.appcompat.app.ActionBar.hide()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.appcompat.app.ActionBar.hide()' on a null object reference
at com.megatechnologyteam.megavidi.SplashActivity.onCreate(SplashActivity.java:20)
at android.app.Activity.performCreate(Activity.java:6975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
我该如何解决才能使我的APP正常运行?
请帮帮我

最佳答案

请在代码中找到对象

com.megatechnologyteam.megavidi.SplashActivity.onCreate(SplashActivity.java:20)
应该有一个试图调用hide()的ActionBar类的对象。
该正义对象实际上为空。请检查。

关于android - 打开应用后,ANDROID应用会停止崩溃,以提供消息 “HAS STOPPED WORKING”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63614966/

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