Start new Activity outside the Activity context.
问题 I tried to start an Activity and close other in my AsyncTask class ( onPostExecute() ). My code : Intent i = new Intent(parentActivity, ThunderHunter.class); c.startActivity(i); parentActivity.finish(); But it doesn't work, logcat shows : 08-01 18:01:27.640: E/AndroidRuntime(12398): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? 08-01 18:01:27.640: E/AndroidRuntime(12398)