Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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....

 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!