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
Ian Z
14,584 PointsRecipients Activity onListItemClick "cannot resolve method" what do i do? (android studio)
when Ben types onListItemClick a @override method is auto generated for him. Mine will not auto generate and will be underlined in red.
I think this has to do with the fact i have to extend ActionBarActivity instead of ListActivity for the action bar fix in android studio.
I tried doing mListview = (ListView) findViewById(R.id.receipientsListView); and doing mListView.onListItemClick but it is still red:(
Murat Hasdemir
Front End Web Development Techdegree Graduate 20,968 Pointsplease add code block. have to say code Ben working on is a special code for ListActivity so it wont work the same way in other activities.
jon1234
5,022 PointsYou have to do
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> l, View view, int position, long id) {
if (mListView.getCheckedItemCount() > 0) {
mSendMenuItem.setVisible(true);
}
else {
mSendMenuItem.setVisible(false);
}
}
});
Ian Z
14,584 PointsIan Z
14,584 Pointsthis is for this vid https://teamtreehouse.com/library/build-a-selfdestructing-message-android-app/sending-messages/adding-a-send-button