在Android中混淆行为与意图

在Android中混淆行为与意图,android,android-intent,Android,Android Intent,我通过意图从我的应用程序中调用GooglePlay,然后在我杀死自己的应用程序后再次调用: Intent intent = new Intent(Intent.ACTION_VIEW); String sModule = "market://search?q=pub:mycompany"; intent.setData(Uri.parse(sModule)); startActivity(intent); finish(); android.os.Process.killProcess(and

我通过意图从我的应用程序中调用GooglePlay,然后在我杀死自己的应用程序后再次调用:

Intent intent = new Intent(Intent.ACTION_VIEW);
String sModule = "market://search?q=pub:mycompany";
intent.setData(Uri.parse(sModule));
startActivity(intent);

finish();
android.os.Process.killProcess(android.os.Process.myPid());
taskmanager
显示,只有
GooglePlay
正在运行。我的应用程序不再存在了

所以我现在的重点是谷歌游戏。当通过Home按钮进入桌面并再次调用我的应用程序时,它会引导我再次进入GooglePlay

为什么呢?如何从我的应用程序中独立调用GooglePlay

我原以为当我再次启动我的应用程序时,它会启动我的应用程序,而不是专注于google play

关键字是“启动模式”和“任务”。
这类问题在android中非常烦人且非常复杂。
但是这次你可以试试这个

Intent intent = new Intent(Intent.ACTION_VIEW);
String sModule = "market://search?q=pub:mycompany";
intent.setData(Uri.parse(sModule));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);

finish();
如果无法解决,请尝试将其他标志与标志\u活动\u新任务组合。
干杯

你的确切要求是什么?用更多的话来定义。我希望,当再次启动我的应用程序时,它会启动我的应用程序,而不是专注于google play。你试图在没有任何情况/行动的情况下发送直接意图?这只是我更大问题的简化展示。但是你明白我的困惑吗?android:excludeFromRecents=“true”android:noHistory=“true”在你发送意图的清单中的活动标记中声明这一点。完美,它可以工作。这正是我要找的。“新任务”。