Remove geocoding activity from history by FLAG_ACTIVITY_CLEAR_TOP

With this, it's not opened again with onBackPressed in location view. But it still opens again when app was interrupted and being shown again.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2023-03-29 10:45:11 +02:00
parent 1676c9f6da
commit 95afdf7c81
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
2 changed files with 4 additions and 4 deletions

View File

@ -196,13 +196,11 @@
<activity
android:name=".location.LocationPickerActivity"
android:theme="@style/AppTheme"
android:noHistory="true"/>
android:theme="@style/AppTheme" />
<activity
android:name=".location.GeocodingActivity"
android:theme="@style/AppTheme"
android:noHistory="true"/>
android:theme="@style/AppTheme" />
<receiver android:name=".receivers.PackageReplacedReceiver"
android:exported="false">

View File

@ -115,6 +115,7 @@ class GeocodingActivity :
val geocodingResult = GeocodingResult(address.latitude, address.longitude, address.displayName)
val intent = Intent(this, LocationPickerActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
intent.putExtra(BundleKeys.KEY_ROOM_TOKEN, roomToken)
intent.putExtra(BundleKeys.KEY_GEOCODING_RESULT, geocodingResult)
startActivity(intent)
@ -197,6 +198,7 @@ class GeocodingActivity :
override fun onMenuItemActionCollapse(menuItem: MenuItem): Boolean {
val intent = Intent(context, LocationPickerActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
intent.putExtra(BundleKeys.KEY_ROOM_TOKEN, roomToken)
startActivity(intent)
return true