读书人

雷同class的startactivity使用Intent.

发布时间: 2012-09-21 15:47:26 作者: rapoo

相同class的startactivity使用Intent.FLAG_ACTIVITY_MULTIPLE_TASK
void android.content.Context.startActivity(Intent intent)
Launch a new activity. You will not receive any information about when the activity exits.

Note that if this method is being called from outside of an android.app.Activity Context, then the Intent must include the Intent.FLAG_ACTIVITY_NEW_TASK launch flag. This is because, without being started from an existing Activity, there is no existing task in which to place the new activity and thus it needs to be placed in its own separate task.

This method throws ActivityNotFoundException if there was no Activity found to run the given Intent.

Parameters:
intent The description of the activity to start.
Throws:
ActivityNotFoundException
See Also:
PackageManager.resolveActivity

读书人网 >移动开发

热点推荐