Android AsyncQueryHandler - 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 AsyncQueryHandler class.

This code example shows how to use the following methods:startQuery
 
        Uri search = Uri.parse("content://media/external/audio/search/fancy/" + Uri.encode(filter));
 
        Cursor ret = null;
        if (async != null) {
            async.startQuery(0, null, search, ccols, null, null, null);
        } else { 
            ret = MusicUtils.query(this, search, ccols, null, null, null);
        } 
        return ret;
    } 
 
    static class QueryListAdapter extends SimpleCursorAdapter {
        private QueryBrowserActivity mActivity = null;
 
        private final AsyncQueryHandler mQueryHandler;
 
        private String mConstraint = null;
 
        private boolean mConstraintIsValid = false;
5
CodeRank
This code example shows how to use the following methods:startQuery
        } 
    } 
 
    private void startQuery() { 
        try { 
            mQueryHandler.startQuery(0, null, SIM_URI, null, null, null, null);
        } catch (SQLiteException e) {
            SqliteWrapper.checkSQLiteException(this, e);
        } 
    } 
 
    private void refreshMessageList() { 
        updateState(SHOW_BUSY);
        if (mCursor != null) {
            stopManagingCursor(mCursor);
            mCursor.close();
        } 
        startQuery(); 
    } 
 
4
CodeRank
This code example shows how to use the following methods:startQuery
     * until this view is clicked. 
     */ 
    public void assignContactFromPhone(String phoneNumber, boolean lazyLookup) {
        mContactPhone = phoneNumber;
        if (!lazyLookup) {
            mQueryHandler.startQuery(TOKEN_PHONE_LOOKUP, null,
                    Uri.withAppendedPath(TPhoneLookup.getFilterUri(), mContactPhone),
                    PHONE_LOOKUP_PROJECTION, null, null, null);
        } else { 
            mContactUri = null;
            onContactUriChanged(); 
        } 
    } 
 
    public void onClick(View v) {
        if (mContactUri != null) {
            final ContentResolver resolver = getContext().getContentResolver();
            final Uri lookupUri = TContacts.getLookupUri(resolver, mContactUri);
            trigger(lookupUri);
        } else if (mContactEmail != null) {
4
CodeRank
This code example shows how to use the following methods:startQuery
        Uri uri = MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI;
        if (!TextUtils.isEmpty(filter)) {
            uri = uri.buildUpon().appendQueryParameter("filter", Uri.encode(filter)).build();
        } 
        if (async != null) {
            async.startQuery(0, null,
                    uri,
                    cols, null, null, MediaStore.Audio.Albums.DEFAULT_SORT_ORDER);
        } else { 
            ret = MusicUtils.query(this, uri,
                    cols, null, null, MediaStore.Audio.Albums.DEFAULT_SORT_ORDER);
        } 
        return ret;
    } 
 
    @Override 
    protected long fetchCategoryId(Cursor cursor) {
        return cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Audio.Albums._ID));
    } 
 
4
CodeRank
This code example shows how to use the following methods:startDelete
     *            Thread ID of the CBMessages to be deleted 
     */ 
    public static void startDelete(AsyncQueryHandler handler, int token,
            boolean deleteAll, long threadId) {
        Uri uri = ContentUris.withAppendedId(MESSAGE_URI, threadId);
        handler.startDelete(token, null, uri, null, null);
    } 
 
    /** 
     * Start deleting all CBMessagess in the database. 
     *  
     * @param handler 
     *            An AsyncQueryHandler that will receive onDeleteComplete upon 
     *            completion of all CBMessagess being deleted 
     * @param token 
     *            The token that will be passed to onDeleteComplete 
     * @param deleteAll 
     *            Delete the whole thread including locked messages 
     */ 
    public static void startDeleteAll(AsyncQueryHandler handler, int token,
3
CodeRank
This code example shows how to use the following methods:startQuery
        Uri uri = MediaStore.Audio.Artists.EXTERNAL_CONTENT_URI;
        if (!TextUtils.isEmpty(filter)) {
            uri = uri.buildUpon().appendQueryParameter("filter", Uri.encode(filter)).build();
        } 
        if (async != null) {
            async.startQuery(0, null,
                    uri,
                    cols, null, null, MediaStore.Audio.Artists.DEFAULT_SORT_ORDER);
        } else { 
            ret = MusicUtils.query(this, uri,
                    cols, null, null, MediaStore.Audio.Artists.DEFAULT_SORT_ORDER);
        } 
        return ret;
    } 
 
    @Override 
    protected long fetchCategoryId(Cursor cursor) {
        return cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Audio.Artists._ID));
    } 
 
4
CodeRank
This code example shows how to use the following methods:startQuery
        } 
    } 
 
    private void startQuery() { 
        try { 
            mQueryHandler.startQuery(0, null, ICC_URI, null, null, null, null);
        } catch (SQLiteException e) {
            SqliteWrapper.checkSQLiteException(this, e);
        } 
    } 
 
    private void refreshMessageList() { 
        updateState(SHOW_BUSY);
        if (mCursor != null) {
            stopManagingCursor(mCursor);
            mCursor.close();
        } 
        startQuery(); 
    } 
 
4
CodeRank
This code example shows how to use the following methods:startQuery
        } 
    } 
 
    private void startQuery() { 
        try { 
            mQueryHandler.startQuery(0, null, ICC_URI, null, null, null, null);
        } catch (SQLiteException e) {
            SqliteWrapper.checkSQLiteException(this, e);
        } 
    } 
 
    private void refreshMessageList() { 
        updateState(SHOW_BUSY);
        if (mCursor != null) {
            stopManagingCursor(mCursor);
            mCursor.close();
        } 
        startQuery(); 
    } 
 
4
CodeRank
This code example shows how to use the following methods:startQuery
        } 
    } 
 
    private void startQuery() { 
        try { 
            mQueryHandler.startQuery(0, null, ICC_URI, null, null, null, null);
        } catch (SQLiteException e) {
            SqliteWrapper.checkSQLiteException(this, e);
        } 
    } 
 
    private void refreshMessageList() { 
        updateState(SHOW_BUSY);
        if (mCursor != null) {
            stopManagingCursor(mCursor);
            mCursor.close();
        } 
        startQuery(); 
    } 
 
3
CodeRank
This code example shows how to use the following methods:startQuery
        Uri uri = MediaStore.Audio.Genres.EXTERNAL_CONTENT_URI;
        if (!TextUtils.isEmpty(filter)) {
            uri = uri.buildUpon().appendQueryParameter("filter", Uri.encode(filter)).build();
        } 
        if (async != null) {
            async.startQuery(0, null,
                    uri,
                    cols, null, null, MediaStore.Audio.Genres.DEFAULT_SORT_ORDER);
        } else { 
            ret = MusicUtils.query(this, uri,
                    cols, null, null, MediaStore.Audio.Genres.DEFAULT_SORT_ORDER);
        } 
        return ret;
    } 
 
    @Override 
    protected long fetchCategoryId(Cursor cursor) {
        return cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Audio.Genres._ID));
    } 
 
4
CodeRank

Related Android AsyncQueryHandler Questions & Answers:

See Code Examples for Android AsyncQueryHandler Methods: