`
kfc_davy
  • 浏览: 186351 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

相同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
分享到:
评论

相关推荐

    Android双屏异显的工程代码

    在创建针对特定Display的Activity时,可以使用`Intent`的`setFlags()`方法,添加`FLAG_ACTIVITY_NEW_TASK`和`FLAG_ACTIVITY_MULTIPLE_TASK`标志,以及`DISPLAY`额外参数,指定目标Display: ```java Intent intent ...

    实现仿微信选择多张图片,删除, 浏览等,以九宫格的样式显示,最多可显示九张图片

    为了支持多选,我们需要使用Intent.ACTION_GET_CONTENT并设置FLAG_ACTIVITY_MULTIPLE_TASK标志。 ```java Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("image/*"); intent.putExtra...

    android面试常见问题

    - **FLAG_ACTIVITY_MULTIPLE_TASK**: 表示可以在多个任务堆栈中启动此Activity。 - **FLAG_ACTIVITY_NEW_TASK**: 如果目标Activity位于另一个任务堆栈中,则此标志会启动一个新的任务堆栈来承载该Activity。 #### 2...

    微软内部资料-SQL性能优化3

    Byte 0: Flag – 0x00 Byte 1: Resource Type – 0x07 (Key) Byte 2-3: DBID – 0x0005 Byte 4-7: ObjectID – 0x 75D7831F (1977058079) Byte 8-9: IndexID – 0x0001 Byte 10-16: Hash Key value – 0x 02014F0...

    微软内部资料-SQL性能优化2

    For a process to access 3 GB of address space, the executable image must have been linked with the /LARGEADDRESSAWARE flag or modified using Imagecfg.exe. It should be pointed out that SQL Server was ...

Global site tag (gtag.js) - Google Analytics