Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-Android
Commits
e7cd90f1
Commit
e7cd90f1
authored
Jul 06, 2014
by
Jean-Baptiste Kempf
Browse files
Avoid crash in Preferences
More checks and exception catching...
parent
270a40cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
View file @
e7cd90f1
...
...
@@ -32,6 +32,7 @@ import org.videolan.vlc.util.BitmapCache;
import
org.videolan.vlc.util.Util
;
import
android.app.AlertDialog
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
...
...
@@ -49,6 +50,7 @@ import android.preference.PreferenceActivity;
import
android.preference.PreferenceManager
;
import
android.preference.PreferenceScreen
;
import
android.text.format.DateFormat
;
import
android.view.Window
;
import
android.widget.Toast
;
@SuppressWarnings
(
"deprecation"
)
...
...
@@ -296,12 +298,18 @@ public class PreferencesActivity extends PreferenceActivity implements OnSharedP
public
boolean
onPreferenceTreeClick
(
PreferenceScreen
preferenceScreen
,
Preference
preference
)
{
super
.
onPreferenceTreeClick
(
preferenceScreen
,
preference
);
if
(
preference
!=
null
)
if
(
preference
instanceof
PreferenceScreen
)
if
(((
PreferenceScreen
)
preference
).
getDialog
()!=
null
)
((
PreferenceScreen
)
preference
).
getDialog
().
getWindow
().
getDecorView
()
.
setBackgroundDrawable
(
this
.
getWindow
().
getDecorView
().
getBackground
()
.
getConstantState
().
newDrawable
());
try
{
if
(
preference
!=
null
&&
preference
instanceof
PreferenceScreen
)
{
Dialog
dialog
=
((
PreferenceScreen
)
preference
).
getDialog
();
if
(
dialog
!=
null
)
{
Window
window
=
dialog
.
getWindow
();
if
(
window
!=
null
)
window
.
getDecorView
().
setBackgroundDrawable
(
this
.
getWindow
().
getDecorView
().
getBackground
()
.
getConstantState
().
newDrawable
());
}
}
}
catch
(
Exception
e
){}
return
false
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment