Code example for AsyncTaskLoader

0
	protected Cursor mCursor;
	 
	// When constructed, we open the database 
	public DatabaseCursorLoader(Context _context, String _eventToFilter) 
	{ 
		super(_context);
		mDatabaseAdapter = new DatabaseAdapter(getContext());
		mDatabaseAdapter.openReadOnly();
		mEventToFilter = _eventToFilter;
	} 
	 
	protected DatabaseAdapter getDatabaseAdapter() 
	{ 
		return mDatabaseAdapter;
	} 
 
	// When the LoaderManager inits a load, we must call the 
	// forceLoad() method from AsyncTaskLoader. Doing that, we  
	// are launching a new thread, that will execute the  
	// loadInBackground method 
Experience pair programming with AI  Get Codota for Java