FileDocCategorySizeDatePackage
TrackerListHelper.javaAPI DocAndroid 5.1 API2694Thu Mar 12 22:22:44 GMT 2015com.android.locationtracker.data

TrackerListHelper

public class TrackerListHelper extends TrackerDataHelper
Used to bind Tracker data to a list view UI

Fields Summary
private android.app.ListActivity
mActivity
private static final String
SORT_ORDER
Constructors Summary
public TrackerListHelper(android.app.ListActivity activity)


       
        super(activity, TrackerDataHelper.CSV_FORMATTER);
        mActivity = activity;
    
Methods Summary
public voidbindListUI(int layout)
Helper method for binding the list activities UI to the tracker data Tracker data will be sorted in most-recent first order Will enable automatic UI changes as tracker data changes

param
layout - layout to populate data

        Cursor cursor = mActivity.managedQuery(TrackerProvider.CONTENT_URI,
                TrackerEntry.ATTRIBUTES, null, null, SORT_ORDER);
        // Used to map tracker entries from the database to views
        TrackerAdapter adapter = new TrackerAdapter(mActivity, layout, cursor);
        mActivity.setListAdapter(adapter);
        cursor.setNotificationUri(mActivity.getContentResolver(),
                TrackerProvider.CONTENT_URI);