1
我正在嘗試完成一項活動。代碼正在執行,但活動仍停留在後臺。完成不在活動上工作
此問題僅在帶有OS(6.0.1)的Samsung S5上出現。一切在其他設備上按預期工作。
這是代碼。
Intent intent = new Intent(AccessTokenReceiverFitbit.this, PairDeviceStatusActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("fragment_to_load", "wearable");
startActivity(intent);
finish();
請讓我知道是什麼問題。
代碼執行後,您的上一個活動是否在任務堆棧中可見?當您從新的活動中按回時,是否會將您帶回舊活動或關閉該應用程序? –
先做完()然後開始執行 –
try this.finish(); – Queendevelopers