[Android] Fix native crash when dismissing a dialog too early
Nicolas Pomepuy
git at videolan.org
Thu Dec 10 08:17:40 CET 2020
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Dec 9 12:18:05 2020 +0100| [176d77d7aa47750898018e29e0975e2372fe4145] | committer: Nicolas Pomepuy
Fix native crash when dismissing a dialog too early
Fixes #1567
> https://code.videolan.org/videolan/vlc-android/commit/176d77d7aa47750898018e29e0975e2372fe4145
---
.../org/videolan/vlc/gui/dialogs/SubtitleDownloaderDialogFragment.kt | 2 +-
.../vlc-android/src/org/videolan/vlc/gui/dialogs/VideoTracksDialog.kt | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitleDownloaderDialogFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitleDownloaderDialogFragment.kt
index 73e6461a6..80d4fd88c 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitleDownloaderDialogFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitleDownloaderDialogFragment.kt
@@ -83,9 +83,9 @@ class SubtitleDownloaderDialogFragment : VLCBottomSheetDialogFragment() {
uris = savedInstanceState?.getParcelableArrayList<Uri>(MEDIA_PATHS)?.toList()
?: arguments?.getParcelableArrayList<Uri>(MEDIA_PATHS)?.toList() ?: listOf()
- if (uris.isEmpty()) dismiss()
viewModel = ViewModelProvider(requireActivity(), SubtitlesModel.Factory(requireContext(), uris[0])).get(uris[0].path!!, SubtitlesModel::class.java)
+ if (uris.isEmpty()) dismiss()
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VideoTracksDialog.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VideoTracksDialog.kt
index 0a9bf1960..132a305b4 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VideoTracksDialog.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/VideoTracksDialog.kt
@@ -132,8 +132,8 @@ class VideoTracksDialog : VLCBottomSheetDialogFragment() {
popup.menuInflater.inflate(R.menu.audio_track_menu, popup.menu)
popup.show()
popup.setOnMenuItemClickListener {
- dismiss()
menuItemListener.invoke(it.itemId)
+ dismiss()
true
}
}
@@ -143,8 +143,8 @@ class VideoTracksDialog : VLCBottomSheetDialogFragment() {
popup.menuInflater.inflate(R.menu.subtitle_track_menu, popup.menu)
popup.show()
popup.setOnMenuItemClickListener {
- dismiss()
menuItemListener.invoke(it.itemId)
+ dismiss()
true
}
}
More information about the Android
mailing list