[Android] Close the permission dialog activity when the user chooses to cancel it

Nicolas Pomepuy git at videolan.org
Mon Mar 14 10:31:58 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Mar 14 08:54:03 2022 +0100| [dfd046f65142500dbfeee437732f334404ffa55b] | committer: Nicolas Pomepuy

Close the permission dialog activity when the user chooses to cancel it

Fixes #2432

> https://code.videolan.org/videolan/vlc-android/commit/dfd046f65142500dbfeee437732f334404ffa55b
---

 application/vlc-android/src/org/videolan/vlc/util/Permissions.kt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/util/Permissions.kt b/application/vlc-android/src/org/videolan/vlc/util/Permissions.kt
index d0357856c..4543d899b 100644
--- a/application/vlc-android/src/org/videolan/vlc/util/Permissions.kt
+++ b/application/vlc-android/src/org/videolan/vlc/util/Permissions.kt
@@ -190,7 +190,10 @@ object Permissions {
                 .setIcon(R.drawable.ic_warning)
                 .setPositiveButton(activity.getString(R.string.ok)) { _, _ ->
                     listener.invoke(true)
-                }.setNegativeButton(activity.getString(R.string.cancel)) { _, _ -> listener.invoke(false) }
+                }.setNegativeButton(activity.getString(R.string.cancel)) { _, _ ->
+                    activity.finish()
+                    listener.invoke(false)
+                }
                 .setCancelable(false)
         return dialogBuilder.show().apply {
             if (activity is AppCompatActivity) activity.lifecycle.addObserver(object : LifecycleObserver {



More information about the Android mailing list