Reputation: 31
I have looked everywhere for examples on how I can have individual fragments set up as in a list view. It seems either this is highly not recommended or not possible. Does anyone have examples that I can look at? Essentially the app that I am trying to build is a an e-commerce app with a list of items to purchase. I know it may be overkill to have every item to be listed as a fragment but for this project, I need to do this.
Upvotes: 1
Views: 66
Reputation: 90
This is highly not recommended. If your using a ListView then your xml layout file for each list item will be the same. Ideally if you use a ListView your elements will be mostly the same. You could have one Fragment for when an item is selected from your ListView, however. This one Fragment will be able to function properly for all elements of the ListView. That way you only have on Fragment for all of the elements in your ListView. Having a Fragment for each item in a ListView would be very inefficient.
Upvotes: 1