List Most Frequently Selected Items(3 Items) At Top Of The Adapter Using Android List Fragments?
I've used list fragment and list view for displaying manufacture items. For that I've created a manufacture adapter for list out the items and it list more than hundred items. Now
Solution 1:
ManufacturerListAdapter
will need to return those "mostly frequently selected items" for the first few row positions (e.g., 0
, 1
, and 2
), with the others in whatever order you wish.
Since ManufacturerListAdapter
would appear to be a subclass of CursorAdapter
, one approach is:
- Do one query to get your "mostly frequently selected items" into one
Cursor
- Do another query to get the rest, in the desired order, into another
Cursor
- Stitch the two
Cursor
objects together using aMergeCursor
- Use the
MergeCursor
with yourManufacturerListAdapter
Post a Comment for "List Most Frequently Selected Items(3 Items) At Top Of The Adapter Using Android List Fragments?"