From 7b0254842702d780cd5751480c4b3b8da5c06715 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Wed, 6 May 2015 00:17:28 +0200 Subject: [PATCH] Clear task stack after discovery (#33) --- .../gadgetbridge/miband/MiBandPairingActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/MiBandPairingActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/MiBandPairingActivity.java index 67b7ca37..8bd28b47 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/MiBandPairingActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/MiBandPairingActivity.java @@ -49,7 +49,7 @@ public class MiBandPairingActivity extends Activity { macAddress = intent.getStringExtra(DeviceCoordinator.EXTRA_DEVICE_MAC_ADDRESS); if (macAddress == null) { Toast.makeText(this, getString(R.string.message_cannot_pair_no_mac), Toast.LENGTH_SHORT).show(); - startActivity(new Intent(this, DiscoveryActivity.class)); + startActivity(new Intent(this, DiscoveryActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)); finish(); return; } @@ -92,7 +92,7 @@ public class MiBandPairingActivity extends Activity { sharedPrefs.edit().putString(GB.PREF_DEVELOPMENT_MIBAND_ADDRESS, macAddress).apply(); } - Intent intent = new Intent(this, ControlCenter.class); + Intent intent = new Intent(this, ControlCenter.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); finish(); }