[Android] Fix dialogs not displayed
Geoffrey Métais
git at videolan.org
Thu Mar 16 15:48:09 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 16 15:44:35 2017 +0100| [5c609fd71017e8ce67a3269008f55608ba6adcb2] | committer: Geoffrey Métais
Fix dialogs not displayed
> https://code.videolan.org/videolan/vlc-android/commit/5c609fd71017e8ce67a3269008f55608ba6adcb2
---
.../src/org/videolan/vlc/gui/DialogActivity.java | 32 ++++++++++------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/DialogActivity.java b/vlc-android/src/org/videolan/vlc/gui/DialogActivity.java
index d5f7da4..bc5e529 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DialogActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DialogActivity.java
@@ -25,6 +25,7 @@ package org.videolan.vlc.gui;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
+import android.text.TextUtils;
import org.videolan.vlc.MediaParsingService;
import org.videolan.vlc.gui.dialogs.ExternalStorageDialog;
@@ -46,25 +47,20 @@ public class DialogActivity extends BaseActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String key = getIntent().getAction();
- switch (key) {
- case KEY_LOGIN:
- setupLoginDialog(key);
- break;
- case KEY_QUESTION:
- setupQuestionDialog(key);
- break;
- case KEY_PROGRESS:
- setupProgressDialog(key);
- break;
- case KEY_STREAM:
- setupStreamDialog();
- break;
- case KEY_STORAGE:
- setupStorageDialog();
- break;
- default:
- finish();
+ if (TextUtils.isEmpty(key)) {
+ finish();
+ return;
}
+ if (key.startsWith(KEY_LOGIN))
+ setupLoginDialog(key);
+ else if (key.startsWith(KEY_QUESTION))
+ setupQuestionDialog(key);
+ else if (key.startsWith(KEY_PROGRESS))
+ setupProgressDialog(key);
+ else if (KEY_STREAM.equals(key))
+ setupStreamDialog();
+ else if (KEY_STORAGE.equals(key))
+ setupStorageDialog();
}
private void setupStorageDialog() {
More information about the Android
mailing list