Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
アプリケーションを介して別のアプリケーションを起動しているので、そのアプリケーションのインスタンスが既にスタックにあるかどうかを確認したいですか? 存在する場合は、起動前にすべてのインスタンスをクリアします。
このフラグをインテントに追加してみてください
Intent intent= getPackageManager().getLaunchIntentForPackage("com.package.address"); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent);