Android Loader - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Loader class.

This code example shows how to use the following methods: onContentChanged
    this.loader=loader;
  } 
 
  @Override 
  protected void onPostExecute(T3 param) {
    loader.onContentChanged();
  } 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getId
        return null; 
    } 
 
    @Override 
    public void onLoadFinished(Loader loader, Cursor data) {
        switch (loader.getId()) {
            case LOADER_GROUPS: {
                setData(data);
                break; 
            } 
        } 
    } 
 
    private void setData(Cursor groups) {
        MatrixCursor psuedoGroups = new MatrixCursor(new String[] { "_id", "name" });
        psuedoGroups.newRow().add(-1).add("All Contacts");
        psuedoGroups.newRow().add(-2).add("Favorites");
        mAdapter.changeCursor(new MergeCursor(new Cursor[] { psuedoGroups, groups }));
    } 
 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getId
        return null; 
    } 
 
    @Override 
    public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
        if (loader.getId() == LOADER_SNAPSHOTS) {
            if (mAdapter == null) {
                mAdapter = new SnapshotAdapter(getActivity(), data);
                mGrid.setAdapter(mAdapter);
            } else { 
                mAdapter.changeCursor(data);
            } 
            if (mAnimateId > 0) {
                mAdapter.animateIn(mAnimateId);
                mAnimateId = 0;
                getArguments().remove(EXTRA_ANIMATE_ID);
            } 
            boolean empty = mAdapter.isEmpty();
            mGrid.setVisibility(empty ? View.GONE : View.VISIBLE);
            mEmpty.setVisibility(empty ? View.VISIBLE : View.GONE);
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getId
    } 
 
    @Override 
    public void onLoaderReset(Loader<Cursor> cursorLoader) {
        mDisplayView.setText("");
        switch (cursorLoader.getId()) {
            case ID_CHANGE_LOADER:
                mChangeAdapter.swapCursor(null);
                break; 
            case ID_DELETE_LOADER:
                mDeleteAdapter.swapCursor(null);
                break; 
        } 
    } 
 
    private class DeleteCursorWrapper extends CursorWrapper {
 
        /** 
         * Creates a cursor wrapper. 
         * 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getId
 
	@Override 
	public void onLoaderReset(Loader<Cursor> loader) {
		if (loader == null)
			return; 
		int id = loader.getId();
		if (DEBUG) Log.d(TAG, "enter onLoaderReset: " + id);
		switch (id) {
			case PRIMARY_LOADER:
			break; 
			case SPECIES_LOADER:
				speciesAdapter.swapCursor(null);
			break; 
			case BREED_LOADER:
				breedAdapter.swapCursor(null);
			break; 
		} 
		if (DEBUG) Log.d(TAG, "leave onLoaderReset: " + id);
	} 
 
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android Loader Questions & Answers:

See Code Examples for Android Loader Methods: