mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
CB-8510 CB-7159 Fix background color manual test page not showing flash of green
This commit is contained in:
parent
d99856c52b
commit
455298d736
@ -181,12 +181,13 @@ public class CordovaActivity extends Activity {
|
||||
LOG.d(TAG, "removing appView from existing parent");
|
||||
ViewGroup parentGroup = (ViewGroup) parent;
|
||||
parentGroup.removeView(appView.getView());
|
||||
if (preferences.contains("BackgroundColor")) {
|
||||
int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
|
||||
// Background of activity:
|
||||
appView.getView().setBackgroundColor(backgroundColor);
|
||||
}
|
||||
root.addView(appView.getView());
|
||||
setContentView(root);
|
||||
|
||||
int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
|
||||
root.setBackgroundColor(backgroundColor);
|
||||
appView.getView().requestFocusFromTouch();
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,11 @@ public class CordovaPreferences {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
// Added in 4.0.0
|
||||
public boolean contains(String name) {
|
||||
return getString(name, null) != null;
|
||||
}
|
||||
|
||||
public int getInteger(String name, int defaultValue) {
|
||||
name = name.toLowerCase(Locale.ENGLISH);
|
||||
String value = prefs.get(name);
|
||||
|
Loading…
Reference in New Issue
Block a user