0
我使用上下文从非Activity类启动Activity。该活动开始正常,但我需要启动后立即实例。有什么办法可以实例吗?获取已启动活动的实例
这里是我的代码如下所示:
Intent intent = new Intent(MyApp.getAppContext(), MyActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
MyApp.getAppContext().startActivity(intent);
Activity a = ???
doSomethingWithInstace(a);
不,如果你需要这个,那么你应该再次阅读http://d.android.com – Selvin
不,你无法做到这一点,对不起。 API不提供解决方案。 – Sajmon