mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-11 00:00:05 +08:00
making preference reading code more robust
This commit is contained in:
@@ -329,7 +329,7 @@ public class DroidGap extends PhonegapActivity {
|
||||
|
||||
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
|
||||
|
||||
if (preferences.pref("fullscreen").equals("true")) {
|
||||
if (preferences.prefMatches("fullscreen","true")) {
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
} else {
|
||||
@@ -1901,7 +1901,8 @@ public class DroidGap extends PhonegapActivity {
|
||||
String value = xml.getAttributeValue(null, "value");
|
||||
String readonlyString = xml.getAttributeValue(null, "readonly");
|
||||
|
||||
boolean readonly = (readonlyString.equals("true"));
|
||||
boolean readonly = (readonlyString != null &&
|
||||
readonlyString.equals("true"));
|
||||
|
||||
LOG.i("PhoneGapLog", "Found preference for %s", name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user