Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom ListView in Fragments

 
Gokul Kesavalu
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Please suggest me how to create a custom Listview in Fragments for Tablet development (Android 3.0).

Please suggest some good links.


Thanks & Regards,
Gokul.K
 
Vishal Trivedi
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry i did not understand what fragment means can you please elaborate

But here are steps that are roughly same for any kind of custom list

1. Add a listView to your main.xml(or the layout xml corresponding to your Activity class)
2. Make a CustomAdapter class by extending ArrayAdapter/BaseAdapter etc.
3. Implement its constructor (as per your needs) methods getItem and getView
4. Create your custom layout file
5. Make a ListView object and connect to your main layout by using findViewById
6. Create an object of your customAdapter and pass it as an object to setAdapter ()

This is usually how it works....

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic