java - Your content must have a ListView whose id attribute is 'android.R.id.list' when extending ListActivity -


this question has answer here:

logcat

06-02 15:53:34.742: e/trace(1188): error opening trace file: no such file or directory (2) 06-02 15:53:36.682: d/dalvikvm(1188): gc_for_alloc freed 49k, 7% free 2539k/2708k, paused 483ms, total 484ms 06-02 15:53:36.712: i/dalvikvm-heap(1188): grow heap (frag case) 3.666mb 1127536-byte allocation 06-02 15:53:36.782: d/dalvikvm(1188): gc_for_alloc freed 1k, 5% free 3639k/3812k, paused 69ms, total 69ms 06-02 15:53:36.902: d/dalvikvm(1188): gc_concurrent freed <1k, 5% free 3639k/3812k, paused 15ms+42ms, total 123ms 06-02 15:53:37.672: i/choreographer(1188): skipped 49 frames!  application may doing work on main thread. 06-02 15:53:37.705: d/gralloc_goldfish(1188): emulator without gpu emulation detected. 06-02 15:53:40.412: d/androidruntime(1188): shutting down vm 06-02 15:53:40.412: w/dalvikvm(1188): threadid=1: thread exiting uncaught exception (group=0x40a71930) 06-02 15:53:40.612: e/androidruntime(1188): fatal exception: main 06-02 15:53:40.612: e/androidruntime(1188): java.lang.runtimeexception: unable start activity componentinfo{testing.android.application.three/testing.android.application.three.mainactivitynext}: java.lang.runtimeexception: content must have listview id attribute 'android.r.id.list' 06-02 15:53:40.612: e/androidruntime(1188):     @ android.app.activitythread.performlaunchactivity(activitythread.java:2180) 06-02 15:53:40.612: e/androidruntime(1188):     @ android.app.activitythread.handlelaunchactivity(activitythread.java:2230) 06-02 15:53:40.612: e/androidruntime(1188):     @ android.app.activitythread.access$600(activitythread.java:141) 06-02 15:53:40.612: e/androidruntime(1188):     @ android.app.activitythread$h.handlemessage(activitythread.java:1234) 06-02 15:53:40.612: e/androidruntime(1188):     @ android.os.handler.dispatchmessage(handler.java:99) 06-02 15:53:40.612: e/androidruntime(1188):     @ android.os.looper.loop(looper.java:137) 06-02 15:53:40.612: e/androidruntime(1188):     @ android.app.activitythread.main(activitythread.java:5041) 06-02 15:53:40.612: e/androidruntime(1188):     @ java.lang.reflect.method.invokenative(native method) 06-02 15:53:40.612: e/androidruntime(1188):     @ java.lang.reflect.method.invoke(method.java:511) 06-02 15:53:40.612: e/androidruntime(1188):     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:793) 06-02 15:53:40.612: e/androidruntime(1188):     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:560) 06-02 15:53:40.612: e/androidruntime(1188):     @ dalvik.system.nativestart.main(native method) 06-02 15:53:40.612: e/androidruntime(1188): caused by: java.lang.runtimeexception: content must have listview id attribute 'android.r.id.list' 06-02 15:53:40.612: e/androidruntime(1188):     @ android.app.listactivity.oncontentchanged(listactivity.java:243) 06-02 15:53:40.612: e/androidruntime(1188):     @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:273) 06-02 15:53:40.612: e/androidruntime(1188):     @ android.app.activity.setcontentview(activity.java:1881) 06-02 15:53:40.612: e/androidruntime(1188):     @ testing.android.application.three.mainactivitynext.oncreate(mainactivitynext.java:28) 06-02 15:53:40.612: e/androidruntime(1188):     @ android.app.activity.performcreate(activity.java:5104) 06-02 15:53:40.612: e/androidruntime(1188):     @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1080) 06-02 15:53:40.612: e/androidruntime(1188):     @ android.app.activitythread.performlaunchactivity(activitythread.java:2144) 06-02 15:53:40.612: e/androidruntime(1188):     ... 11 more 06-02 15:53:44.662: i/process(1188): sending signal. pid: 1188 sig: 9 

your problem trying extends listactivity , don't have listview with

android:id="android.r.id.list" 

you need have listview in xml id. please add xml

you can tell following line in logcat

caused by: java.lang.runtimeexception: content must have listview id attribute 'android.r.id.list' 

if find next line references activity tell class , line number

at testing.android.application.three.mainactivitynext.oncreate(mainactivitynext.java:28) 

so mainactivitynext line 28 showing exception.

note

as stated in comment, please don't post unformatted logcat when asking help. please try error occurring , post relevant code along description of problem is. 1 easy see error need see code

you can use ctrl+k format code , logcat or use coding brackets above {}


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -