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 trial

Android

Fun Facts app has stopped working on the Emulator. Please help me!

When I run the fun facts app I can't get past the first screen and I get a message saying the app has stopped working.

In the forums I found how to look at the errors in the logcat but the problem is I don't understand them , nothing familiar is cropping up.

The problem started when I changed the text colour to match the background colour.

Below is the logcat errors when I try to run the app.

Can you fellow tree housers help me solve this?

Thanks!!

08-06 07:43:47.990 5897-5897/orlamcgreal.extracredit E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: orlamcgreal.extracredit, PID: 5897 android.content.res.Resources$NotFoundException: String resource ID #0xfff092b0 at android.content.res.Resources.getText(Resources.java:299) at android.widget.TextView.setText(TextView.java:4132) at orlamcgreal.extracredit.Extre$1.onClick(Extre.java:42) at android.view.View.performClick(View.java:4780) at android.view.View$PerformClick.run(View.java:19866) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

2 Answers

Well if you read one of the lines it reads:

android.content.res.Resources$NotFoundException: String resource ID #0xfff092b0

I'm guessing that you have a resource file that is missing Run the application again, when it breaks Click on the java 299 that takes you to the line where it is breaking.

Good Luck

Hi Dhruv, Thanks so much for the help.

I have done that and now am at the line of broken code but don't know how to fix it... Below is the code along with the lines above it. I understand that a string id has not been found , but I have looked at the main screen ones and they seem ok. I'm a bit confused. Any help you can give me would be great!!

public CharSequence getText(int id) throws NotFoundException { CharSequence res = mAssets.getResourceText(id); if (res != null) { return res; } throw new NotFoundException("String resource ID #0x" + Integer.toHexString(id)); }