Created
April 11, 2016 09:27
-
-
Save sheerazam/32c24a614eb0cab432f7240e78a0f04f to your computer and use it in GitHub Desktop.
Cursor Loader for database.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DriverActivity extends BaseActivity implements DriverView, LoaderManager.LoaderCallbacks<Cursor> | |
String [] PROJECTION = new String [] { | |
DBDriver.Columns._ID, | |
DBDriver.Columns.RATTING, | |
DBDriver.Columns.PHONE_NUMBER, | |
DBDriver.Columns.ADDRESS1, | |
DBDriver.Columns.IMAGE | |
}; | |
@Override | |
public Loader<Cursor> onCreateLoader(int id, Bundle args) { | |
return new CursorLoader(this, DBDriver.CONTENT_URI, PROJECTION, null, null, DBDriver.Columns._ID + " ASC" ); | |
} | |
@Override | |
public void onLoadFinished(Loader<Cursor> loader, Cursor data) { | |
if( data.moveToNext() ) { | |
} | |
} | |
@Override | |
public void onLoaderReset(Loader<Cursor> loader) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment