Activity { static class MyAsyncTask extends AsyncTask<Void, Void, Void> { private WeakReference<MyActivity> mRef; public MyAsyncTask(MyActivity activity) { mRef = new WeakReference<>(activity); } @Override public Void doInBackground(Void… args) { // do something heavy return null; } @Override public void onPostExecute(Void result) { // callback to activity } } } 16 1.0 1.1 Cupcake Donut Eclair Froyo Gingerbread Honeycomb Ice Cream Sandwich Jelly Bean Kitkat Lollipop Marshmallow Nougat Oreo