File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Android and the fly likes How to get info from List Fragment item Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "How to get info from List Fragment item" Watch "How to get info from List Fragment item" New topic

How to get info from List Fragment item

Melanie Peterson

Joined: Nov 16, 2012
Posts: 1

Hi - I have a ListFragment that is populated using a CursorLoader. Once the ListFragment is populated, I have an OnItemClickListener method in which I want to identify which item from the List Fragment the user chose. How do I do this? I've tried:

Where position is an integer passed to the onClickItemListener method like so:

All of these throw Cast Exceptions of one type or another. I'm stumped. This seems like a simple thing to do. For your reference, here's how the List Fragment is populated:

Any suggestions would be most welcome, thanks!
I agree. Here's the link:
subject: How to get info from List Fragment item
Similar Threads
problems with row position in Cursor Listview Adapter
Question on retrieving just only "Mobile" TYPE
how to create sdcard and mount on the emulator
Problems with listview and checkbox event
webview help......