這是我在 Logcat 中單擊“登錄”按鈕時(shí)收到的錯(cuò)誤:Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference at com.virtual.ai.Home.onCreate(Home.java:92) at android.app.Activity.performCreate(Activity.java:7149) at android.app.Activity.performCreate(Activity.java:7140) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1288) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3017) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6863) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 2019-06-28 12:59:05.812 23283-23283/com.virtual.ai W/OPDiagnose: getService:OPDiagnoseService NULL 2019-06-28 12:59:05.815 23283-23506/com.virtual.ai D/OSTracker:操作系統(tǒng)事件:崩潰 2019-06-28 12:59:05.828 23283-23506/com.virtual.ai D/AbstractTracker:事件成功錯(cuò)誤似乎指的是 txtFullName.setText(Common.currentUser.getNa()); 第 18 行,不確定出了什么問題。任何人,任何解決方案。當(dāng)我點(diǎn)擊我得到上面的 Logcat 時(shí),我無法執(zhí)行登錄活動(dòng)。
void android.widget.TextView.setText
當(dāng)年話下
2023-02-23 11:16:50