Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Blog Reader Android App Rebuilding from Scratch Creating the Project and ListActivity

Unfortunately, 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!

Harry James
Harry James
14,780 Points

Hey Wasif!

Can you please provide the Logcat of the crash here and I'll take a look? :)

01-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 !

I Think This Is The Actual Problem!

java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'

Well 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
Harry James
14,780 Points

Hmm...

Are you getting any errors? If so, provide a new Logcat. If not, post your code onto here and I'll take a look.

01-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

The ListView Id is "@android:id/list" but it still doesn't work

4 Answers

Harry James
Harry James
14,780 Points

It 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 :)

In the xml layout file for your MainActivity, is your ListView id set to "@android:id/list" ? If not, try setting it to that.

Im 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

Im 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
Harry James
14,780 Points

Have 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.

it is still not working