我希望在ListActivity中实现一个Loader,但该活动不能识别getLoaderManager.
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); dbHelper = new DBHelper(this,DBNAME,FindPackageName(),TABLE_NAME); sql = dbHelper.getReadableDataBase(); //Log.d("Gaurav","Database Open"); String[] from = new String[]{"word","_id","MyList"}; int[] to = new int[]{R.id.listrow }; simpleCursorLoader = new SimpleCursorLoader(this,TABLE_NAME,from,null,sql); //query result will be whole database //cursor = sql.query(TABLE_NAME,null); //startManagingCursor(cursor); //this method is deprecated //Log.d(TAG,"Cursor Set"); completerOrMyListAdapter = new CompleteOrMyListAdapter(this,R.layout.completeormylist_adapter,cursor,to,dbHelper); setListAdapter(completerOrMyListAdapter); // Prepare the loader. Either re-connect with an existing one,// or start a new one. LoaderManager lm = getLoaderManager(); //if (lm.getLoader(0) != null) { // lm.initLoader(0,this); //} //getLoaderManager().initLoader(0,this); }