One, my code is as follows: That's me. TextView Setting values
if (listnull) { forlist) { //如果一下子赋值的话是不正确的 tv_name.setText(stu.getName()); tv_sex.setText(stu.getSex()); tv_age.setText(stu.getAge()); }}
To report an error:
Geneva-Geneva ,: About:33.950: W/resourcetype (23332): No Package identifier if getting value for resource number0x0000000cGeneva-Geneva ,: About:33.950: D/androidruntime (23332): Shutting down VMGeneva-Geneva ,: About:33.950: W/DALVIKVM (23332): threadid=1: Thread exiting with uncaught exception (group=0x416ddd58)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): FATAL Exception:mainGeneva-Geneva ,: About:33.960: E/androidruntime (23332): Process:com. Xuliugen. StudentsytemPid:23332Geneva-Geneva ,: About:33.960: E/androidruntime (23332): Android. Content. Res. Resources$NotFoundException: String Resource ID#0xcAndroid. Content. Res. Resources. GetText(Resources. Java:252)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): at Android. Content. Res. Miuiresources. GetText(miuiresources. Java:107)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): at Android. Widgets. TextView. SetText(TextView. Java:3895)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): atcom. Xuliugen. UI. Activity. Studentmanageractivity$. OnClick(studentmanageractivity. Java: the)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): at Android. View. View. PerformClick(View. Java:4444)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): at Android. View. View$PerformClick. Run(View. Java:18457)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): at Android. OS. Handler. Handlecallback(Handler. Java:733)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): at Android. OS. Handler. DispatchMessage(Handler. Java: the)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): at Android. OS. Looper. Loop(Looper. Java:136)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): at Android. App. Activitythread. Main(Activitythread. Java:5034)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): at Java. Lang. Reflect. Method. Invokenative(Native Method)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): at Java. Lang. Reflect. Method. Invoke(Method. Java:515)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): atcom. Android. Internal. OS. Zygoteinit$MethodAndArgsCaller. Run(Zygoteinit. Java:807)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): atcom. Android. Internal. OS. Zygoteinit. Main(Zygoteinit. Java:623)Geneva-Geneva ,: About:33.960: E/androidruntime (23332): At Dalvik. System. Nativestart. Main(Native Method)
Specific solutions:
if (listnull) { forlist) { //如果一下子赋值的话是不正确的 tv_name.setText(stu.getName()+""); tv_sex.setText(stu.getSex()+""); tv_age.setText(stu.getAge()+""); }}
Error when Android sets settext for TextView