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!

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

Moritz Gruber
Moritz Gruber
12,073 Points

ListActivity and AppCompatActivity

Hello there, I am using android Studio and it suggested me to use a Android Supportlib. to fix some outdated stuff of this project. (Had no actionBar) But now I got again a huge Problem with the ListActivity, because there is no Activity that combines AppCompatActivity and the ListActivity. (one for actionbar, one for list)

Is there an other, more easy way around than using fragments?

regards Moritz

First you have to extend AppCompatActivity in your EditFriendsActivity. Then you have to declare a ListView variable and you have to assign it in the on create method like this: listView = (ListView) findViewById(android.R.id.list); After this you have to set the adapter in the onResume method like this: listView.setAdapter(adapter);

This solves your crash with the theme problem :)

1 Answer

hi, I've just encountered the same problem. Eventually I just used a ListView instead of a ListActivity. a bit more coding but it was the least complicated solution I could find...