应用程序总是从根系活力,而不是恢复的背景状态(已知错误)新鲜根系、是从、应用程序、而不是

2023-09-12 04:16:15 作者:疯狗

我现在面临正是在这些链接中提到的问题:

I am facing exactly the problem mentioned in these links:

http://$c$c.google.com/p/android/issues/detail?id=2373

http://groups.google.com/group/android-developers/browse_thread/thread/77aedf6c7daea2ae/da073056831fd8f3?#da073056831fd8f3

http://groups.google.com/group/android-developers/browse_thread/thread/2d88391190be3303?tvc=2

我有一个简单的根系活力与发射装置和主要意图和闲来无事的。我开始另一项活动用了的没有任何标志或任何额外的的清单中任何责任。

I have a simple root activity with the LAUNCHER and MAIN intents and nothing else. I start another activity with has no flags or anything extra in the manifest whatsoever.

我启动的应用程序(根系活力),并从那里开始的第二个活动。在pressing Home键任务转到后台。在再次启动(从启动或持有的Home键最近的应用程序)的应用程序,它会启动根系活力的新实例在现有堆栈顶部。

I launch the app (root activity) and from there start the 2nd activity. On pressing the Home button the task goes to the background. On launching the app again (from Launcher or from holding the Home button for recent apps) it starts a new instance of the root activity on top of the existing stack.

如果我preSS后退按钮,新的根活动关闭,旧的第二个活动是可见的,这意味着它的推出在同一任务的根系活力,而不是把任务交给了前台。

If I press the back button, the new "root" activity closes and the old 2nd activity is visible, which means its launching the root activity in the same task instead of bring the task to the foreground.

要克服这个我做了根系活力的启动模式的 singleTask 的。现在,当我preSS回家,然后再次启动应用程序,它清除上面的老根任务的活动,并带来了刚刚把整个旧任务的第二个活动就顶到前面的老根的任务推到前台来代替。请注意,老根的任务仍保留其应用程序状态,这意味着它不是一个新的实例,但较高的活动已被杀害。

To counter this I made the root activity's launch Mode singleTask. Now when I press home and launch the app again, it clears the activities above the old root task and brings the old root task to the foreground instead of just bringing the entire old task with the 2nd activity on top to the front. Note that the old root task still retains its application state, which means it wasn't a new instance, but the the higher activities had been killed.

为什么不是固定的,现在的问题呢?它已经快一年了!它甚至发生在从市场上下载的其他应用程序。手动安装方法对我没有影响,但它仍然推出以同样的方式。

Why isn't the problem fixed by now? It's been almost a year! It even occurs on other applications downloaded from the market. The manual install method has no effect for me, it still launches the same way.

推荐答案

这是由于所使用的意图来启动应用程序是不同的。 Eclipse启动使用,没有行动,没有类别的意图的应用程序。该发射器开始使用与android.intent.action.MAIN行动,android.intent.category.LAUNCHER类别意图的应用程序。安装程序启动与android.intent.action.MAIN行动,并没有任何类别的应用程序。

This is due to the intents being used to start the app being different. Eclipse starts an app using an intent with no action and no category. The Launcher starts an app using an intent with android.intent.action.MAIN action and android.intent.category.LAUNCHER category. The installer starts an app with the android.intent.action.MAIN action and no category.

谁提交的错误应该有可能措辞它作为增强的Eclipse插件的请求,因为他们显然希望Eclipse能够有能力pretend是发射器,并使用相同的意图作为启动程序启动的应用程序

Whoever submitted the bug should have probably worded it as a request for enhancement to the Eclipse plugin since they apparently want Eclipse to have the ability to pretend to be the launcher and to start apps using the same intent as the launcher.

 
精彩推荐
图片推荐