我想要的是每次用户从文本视图(q)中的一个文本开始时,文本视图(nm)显示用户所在的数字。简而言之,每次变量的值发生变化时,我都想将该值设置为 TexView (nm) 处的文本。但是,这里它显示一个错误。
按钮不起作用。怎么了?
LOGCAT
04-01 19:54:55.901: E/AndroidRuntime(32078): FATAL EXCEPTION: main
04-01 19:54:55.901: E/AndroidRuntime(32078): java.lang.NullPointerException
04-01 19:54:55.901: E/AndroidRuntime(32078): at com.dreamgoogle.gihf.Quotes$1.onClick(Quotes.java:43)
04-01 19:54:55.901: E/AndroidRuntime(32078): at android.view.View.performClick(View.java:3524)
04-01 19:54:55.901: E/AndroidRuntime(32078): at android.view.View$PerformClick.run(View.java:14194)
04-01 19:54:55.901: E/AndroidRuntime(32078): at android.os.Handler.handleCallback(Handler.java:605)
04-01 19:54:55.901: E/AndroidRuntime(32078): at android.os.Handler.dispatchMessage(Handler.java:92)
04-01 19:54:55.901: E/AndroidRuntime(32078): at android.os.Looper.loop(Looper.java:137)
04-01 19:54:55.901: E/AndroidRuntime(32078): at android.app.ActivityThread.main(ActivityThread.java:4476)
04-01 19:54:55.901: E/AndroidRuntime(32078): at java.lang.reflect.Method.invokeNative(Native Method)
04-01 19:54:55.901: E/AndroidRuntime(32078): at java.lang.reflect.Method.invoke(Method.java:511)
04-01 19:54:55.901: E/AndroidRuntime(32078): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:816)
04-01 19:54:55.901: E/AndroidRuntime(32078): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:583)
04-01 19:54:55.901: E/AndroidRuntime(32078): at dalvik.system.NativeStart.main(Native Method)