[Android] Fix AuthorsActivity not closing when clicking the close button

Nicolas Pomepuy git at videolan.org
Mon Jan 24 11:03:03 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Jan 20 07:51:36 2022 +0100| [fe2833f50e526e9f5367b5e2b7ec23074a80b437] | committer: Nicolas Pomepuy

Fix AuthorsActivity not closing when clicking the close button

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

 .../vlc-android/src/org/videolan/vlc/gui/AuthorsActivity.kt       | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/AuthorsActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/AuthorsActivity.kt
index 9934878dd..ee021c0e2 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/AuthorsActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/AuthorsActivity.kt
@@ -2,6 +2,7 @@ package org.videolan.vlc.gui
 
 import android.os.Bundle
 import android.view.LayoutInflater
+import android.view.MenuItem
 import android.view.ViewGroup
 import androidx.databinding.DataBindingUtil
 import androidx.lifecycle.*
@@ -44,6 +45,13 @@ class AuthorsActivity : BaseActivity() {
 
     }
 
+    override fun onOptionsItemSelected(item: MenuItem): Boolean {
+        when(item.itemId) {
+            android.R.id.home -> finish()
+        }
+        return super.onOptionsItemSelected(item)
+    }
+
     /**
      * Load the authors list from the json file in assets and then populate the list
      */



More information about the Android mailing list