我已经搜索并搜索了这个!Android AppWidget配置 - 开始新任务
所以我有一个应用程序小部件,它有一个配置活动,我可以打开时按下应用程序上的按钮。该方案是:
Had the app opened.
Closed the app with the home button.
Selected to add my widget
I have configured the widget.
Placed on my home screen
Then open the configuration activity again with the button on the widget.
Cancel the new config by pressing back will put me back into the app.
当按下后,我只想回家。
基本上我问的是。我如何在自己的任务/堆栈中启动配置活动?
我已经研究过意图过滤器,但我只是不太确定,或者它可能与它所在的软件包有关,或者可能它不可能!
我想这可能是与我用启动配置活动
Intent configIntent = new Intent(this, Configuration.class);
configIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
remoteView.setOnClickPendingIntent(R.id.config, PendingIntent.getActivity(this, 0, configIntent, PendingIntent.FLAG_UPDATE_CURRENT));
也许是因为我与“本”的背景下,它总是会开始在我的应用程序堆栈启动它的意图... 但悬而未决的意图API是: 的PendingIntent API 1 “需要注意的是,活动就开始在外面现有活动的背景下”
所以,是的,我会停止现在谈,因为我刚刚结束了进入圈子!
编辑
所以在清单试图android:launchMode="singleInstance"
像有人说。这工作,但它停止'startActivityForResult'行为正常工作。 (这是配置活动的全部原因)获取错误:
WARN/ActivityManager(59): Activity is launching as a new task, so cancelling activity result.
所以还是没有找到解决办法。
我面临同样的问题,谢谢你在这里发布你的解决方案。现在我的问题已经解决了,使用你的解决方案! – 2012-03-08 14:27:20