Back to project page simpleprovider.
The source code is released under:
MIT License
If you think the Android project simpleprovider listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.triplet.simpleprovider.sample; /*www .j av a 2 s . c om*/ import android.app.Activity; import android.app.LoaderManager; import android.content.CursorLoader; import android.content.Loader; import android.database.Cursor; import android.database.DatabaseUtils; import android.net.Uri; import android.os.Bundle; public class MainActivity extends Activity implements LoaderManager.LoaderCallbacks<Cursor> { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getLoaderManager().initLoader(0, null, this); } @Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { Uri uri = Uri.parse("content://" + getString(R.string.authority) + "/posts"); return new CursorLoader(this, uri, null, null, null, null); } @Override public void onLoadFinished(Loader<Cursor> loader, Cursor data) { DatabaseUtils.dumpCursor(data); // ... do whatever you want with the cursor } @Override public void onLoaderReset(Loader<Cursor> loader) { } }