gpt4 book ai didi

android - "Unable to start activity , NullPointerException"的原因

转载 作者:行者123 更新时间:2023-11-29 18:10:46 25 4
gpt4 key购买 nike

在我的主要 Activity 中,我有两个按钮,单击其中一个按钮后,
它应该转到下一个 Activity ,但它在 logcat 中给出以下错误:

FATAL EXCEPTION:main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.suven/com.android.suven.Create_Memo}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

最佳答案

AndroidManifest.xml 中注册另一个 Activity ,如下所示:

<activity android:name=".YourActivityName"/>

关于android - "Unable to start activity , NullPointerException"的原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10877459/

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