Created
February 2, 2014 21:23
-
-
Save dmitry-zaitsev/8775198 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyAsyncTask extends AsyncTask<Void, Void, Cursor> { | |
@Override | |
protected Cursor doInBackground(Void... params) { | |
DatabaseHelper helper = new DatabaseHelper(MainActivity.this); | |
return helper.getReadableDatabase().rawQuery("SELECT * FROM myTable", null); | |
} | |
@Override | |
protected void onPostExecute(Cursor cursor) { | |
super.onPostExecute(cursor); | |
Toast.makeText( | |
MainActivity.this, | |
"Count: " + cursor.getCount(), | |
Toast.LENGTH_SHORT | |
).show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment