カーソルからのリストビュー(ローダーなし)
SimpleCursorAdapterアダプター=newSimpleCursorAdapter(
this, // The Activity context
R.layout.list_item, // Points to the XML for a list item
cursor, // Cursor that contains the data to display
dataColumns, // Bind the data in column "text_column"...
viewIDs // ...to the TextView with id "R.id.text_view"
);
カーソルからのリストビュー(ローダーを使用)
コンテナ(リストビューまたはフラグメント)にデータを非同期的にロードするにはローダーが最善のアプローチです。
// Initialize the adapter. Note that we pass a "null" Cursor as the
// third argument. We will pass the adapter a Cursor only when the
// data has finished loading for the first time (i.e. when the
// LoaderManager delivers the data to onLoadFinished). Also note
// that we have passed the "0" flag as the last argument. This
// prevents the adapter from registering a ContentObserver for the
// Cursor (the CursorLoader will do this for us!).
mAdapter = new SimpleCursorAdapter(this, R.layout.list_item,
null, dataColumns, viewIDs, 0);
上記のURLは次のとおりです。
http://www.androiddesignpatterns.com/2012/07/understanding-loadermanager.html