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 Build a Self-Destructing Message Android App Relating Users in Parse.com Selecting Friends from a List

Milad The Computer Guy
Milad The Computer Guy
20,287 Points

Ribbit Errors

So I have just completed Executing a query and selecting a friends from a list parts but : when I run the my program on emulator and in tabs section, when I press the edit friends tab, it automatically stops running and show me: Unfortunately, Ribbit has stopped. any clues?

5 Answers

Guillaume Maka
PLUS
Guillaume Maka
Courses Plus Student 10,224 Points

Check if mUsers is initialize properly before call any method on it !

Milad The Computer Guy
Milad The Computer Guy
20,287 Points

Its a compiler error: java.lang.nullPointerException, refers to this line of my code: String[] usernames = new String[mUsers.size()];

Milad The Computer Guy
Milad The Computer Guy
20,287 Points

Wow, you are a genius, Thanks a lot mate it hadn't been initialized in my done() method before calling the array.

Alex Lumierre
Alex Lumierre
11,010 Points

how to initialize mUsers properly? is it something like this: protected List<ParseUser> mUsers = new List<ParseUser>();

Alex Lumierre
Alex Lumierre
11,010 Points

I got this error, 10-26 22:32:09.095: E/AndroidRuntime(4303): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lucareto.ribbit/com.lucareto.ribbit.EditFriendsActivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list' how do you exactly fixed this? thanks before

Guillaume Maka
Guillaume Maka
Courses Plus Student 10,224 Points

I need to see your EditFriendsActivity.java and your R.java generated file to give you a proper answer.