In my android application I have a MainActivity, I trigger another function by clicking on a button:
ImageButton button_1 = (ImageButton) findViewById(R.id.button_trigger);
button_1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
webView = (WebView) findViewById(R.id.webViewLayout);
MyClass myCls = new MyClass(getApplicationContext());
myCls.getWebView(authWebView);
}
});
In the MyClass class I trigger an AsyncTaks via:
RespsonseGetterTask task = new RespsonseGetterTask();
task.execute(parameter);
which then is implenmented here with postExecute:
private class RespsonseGetterTask extends AsyncTask<String, Void, Boolean> {
@Override
protected Boolean doInBackground(String... args) {
IdTokenResponse response;
try {
response = HttpUtils.request(args);
} catch (IOException e) {
return false;
}
return true;
}
@Override
protected void onPostExecute(Boolean wasSuccess) {
if (wasSuccess) {
logger.debug("SUCCESSFULL");
// take actions
} else {
logger.debug("Error");
// take actions on error
}
}
I can get a IdTokenResponse object, so that my response variable has valid content. So that response object is within that tast, and my MainActivity is not noticed about the recent result.
How can I signal my MainActivity about the response (IdTokenResponse) object ?