I’ve constructed a fully work AsyncTask to handle device authorization, but the only catch is I’m having troubling getting the resulting Bundle back to its instantiation variable to continue processing in the main activity. Here is the AsyncTask instantiation:
Bundle taskResult = new AuthorizeDevice(this).execute(passToAuthroization).get();
I’ve read some literature on the subject and found that the onPostExecute() method may have something to do with that, so with that in mind here it is:
protected void onPostExecute(Bundle result){
dialog.dismiss();
Toast.makeText(context, "background process finished: "+result.getString("UDID"), Toast.LENGTH_SHORT).show();
}
So how do I get that bundle back to the main activity?
Have a callback interface defined like
Implement this interface and do whatever you want with the bundle.
Send its implementations reference to the AsyncTask
In onPostexecute() do