What’s the best practice to start a new activity when AsynTask is finished,
I try to launch it on post execute like this :
@Override
protected void onPostExecute(Void result) {
Log.d(TAG, "end flag game print recap");
//launch activity flag game recap
Intent myIntent = new Intent(context, FlagGameRecapActivity.class);
context.startActivity(myIntent);
super.onPostExecute(result);
}
But i got an Exception : Calling an startActivity() from outside an activity require the flag FLAG_ACTIVITY_NEW_FLAG
Thanks
1 Answer