Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialWasif Ahmed
1,798 PointsUnfortunately, Blog Reader has stopped
when i run my app on the emulator, it says "Unfortunately, Blog Reader has stopped. I am using android studio.
Please Help ASAP!
Wasif Ahmed
1,798 Points01-26 20:09:21.079 1456-1456/com.example.wasifahmed.blogreader E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.example.wasifahmed.blogreader, PID: 1456 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.wasifahmed.blogreader/com.example.wasifahmed.blogreader.MainListActivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list' at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) at android.app.ActivityThread.access$800(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5001) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list' at android.app.ListActivity.onContentChanged(ListActivity.java:243) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:293) at android.app.Activity.setContentView(Activity.java:1929) at com.example.wasifahmed.blogreader.MainListActivity.onCreate(MainListActivity.java:15) at android.app.Activity.performCreate(Activity.java:5231) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)             at android.app.ActivityThread.access$800(ActivityThread.java:135)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)             at android.os.Handler.dispatchMessage(Handler.java:102)             at android.os.Looper.loop(Looper.java:136)             at android.app.ActivityThread.main(ActivityThread.java:5001)             at java.lang.reflect.Method.invokeNative(Native Method)             at java.lang.reflect.Method.invoke(Method.java:515)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)             at dalvik.system.NativeStart.main(Native Method)
Its Pretty Long !
Wasif Ahmed
1,798 PointsI Think This Is The Actual Problem!
java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
Wasif Ahmed
1,798 PointsWell I Fixed The App Not Running But Now I've Got Another Problem!
It doesn't load the list view. all it loads is the action bar at the top
Please Help!
Harry James
14,780 PointsHmm...
Are you getting any errors? If so, provide a new Logcat. If not, post your code onto here and I'll take a look.
Wasif Ahmed
1,798 Points01-27 19:55:57.775 1353-1353/com.example.wasifahmed.blogreader E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from GradienCache
01-27 19:55:57.779 1353-1353/com.example.wasifahmed.blogreader E/OpenGLRenderer﹕ MAX_TEXTURE_SIZE: 16384
01-27 19:55:57.831 1353-1353/com.example.wasifahmed.blogreader E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
01-27 19:55:57.835 1353-1353/com.example.wasifahmed.blogreader E/OpenGLRenderer﹕ MAX_TEXTURE_SIZE: 16384
Wasif Ahmed
1,798 PointsThe ListView Id is "@android:id/list" but it still doesn't work
4 Answers
Harry James
14,780 PointsIt sounds as though this is an issue with your emulator rather than your app.
Please follow the instructions below for the corresponding emulator:
Default Emulator
Go to AVD Manager >> Click the Pencil icon/Edit icon beside the device you are using >> Click Show Advanced Settings >> Make sure Use Host GPU is checked.
If you have made sure that you have Use Host GPU checked, from the same screen, increase the RAM amount (You are getting this error because your emulator is running out of video memory):
Genymotion Emulator
Open Genymotion >> Click on the Settings icon beside the device you are using >> Increase the RAM amount (You are getting this error because your emulator is running out of video memory):
If this does not fix the issue, open Oracle VM VirtualBox >> Click Settings with the device you are using selected >> Go to System and increase the Base Memory.
If again, it is still not fixed, from the same screen, go to Display and increase the Video Memory:
Hope it helps and if you have any more issues, give me a shout :)
elfproductivity
10,489 PointsIn the xml layout file for your MainActivity, is your ListView id set to "@android:id/list" ? If not, try setting it to that.
Wasif Ahmed
1,798 PointsIm pretty sure its a problem with my code because when I run it on a real device it still doesn't show the list view
Wasif Ahmed
1,798 PointsIm pretty sure its a problem with my code because when I run it on a real device it still doesn't show the list view
Harry James
14,780 PointsHave you tried both a real device and an emulator?
If so, paste your code here and I'll take a look and see if anything stands out.
Wasif Ahmed
1,798 Pointsit is still not working
Harry James
14,780 PointsHarry James
14,780 PointsHey Wasif!
Can you please provide the Logcat of the crash here and I'll take a look? :)