开发者

Instantiating activities into new tasks and processes

I have an application with a multi-instance activity. I would like each instance of the activity to appear in a new task and process.

Any suggestions on how to do this? By manipulating the manifest I can cause all instances of the activity to appear in a specific task and process, but I haven't found any way to cause each instance to appear in a different task and process.

(The requirement to开发者_如何学Python have different tasks is that we want each instance of the activity to appear separately in the task list; the requirement for different processes is that each instance of the activity is backed by a chunk of native code with global state. We can't change either of these.)


Well, you could use FLAG_ACTIVITY_MULTIPLE_TASK but the documentation is pretty clear that you should not use it for what you want to do. It's possible that you could end up with a bunch of Activitys that the user has no method of getting back too.

I suggest reexamining your app's architecture. Maybe you can store the link to the native state in a Local Service and have the activity fetch the correct one from it depending on what is in its Intent.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜