The Wayback Machine - https://web.archive.org/web/20200918021652/https://github.com/Madrapps/AsyncQuery
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

AsyncQuery

Build Status Download

Improved AsyncQueryHandler that handles BulkInsert operation

Note: This is literally a copy paste of the AsyncQueryHandler in Android and then modified that to support Bulk Insert operation. All credits goes to the Android Open Source team for writing the original AsyncQueryHandler.

Download

repositories {
  jcenter() // or mavenCentral()
}

dependencies {
  compile 'com.github.madrapps:asyncquery:1.0.1'
}

Usage

You would use this the same way as you would use AsyncQueryHandler except you can now use startBulkInsert()

final DatabaseHandler handler = new DatabaseHandler(getContentResolver());
final Uri uri = new Uri.Builder().scheme(SCHEME).authority(AUTHORITY).appendEncodedPath(ORGANIZATION).build();
handler.startBulkInsert(1, null, uri, getContentValues());
public class DatabaseHandler extends AsyncQueryHandler {

    public DatabaseHandler(ContentResolver cr) {
        super(cr);
    }

    @Override
    protected void onBulkInsertComplete(int token, Object cookie, int result) {
        super.onBulkInsertComplete(token, cookie, result);
        Log.d("DatabaseHandler", "Bulk Insert Done");
    }
}

License

AsyncQuery by Madrapps is licensed under a Apache License 2.0 by Android Open Source Platform.

You can’t perform that action at this time.