mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-30 00:00:04 +08:00
fixed CB-11078 Empty string for BackgroundColor preference crashes application
This closes #316
This commit is contained in:
committed by
Jesse MacFadyen
parent
74ae6651c8
commit
d54a42f0f0
@@ -175,9 +175,14 @@ public class CordovaActivity extends Activity {
|
||||
setContentView(appView.getView());
|
||||
|
||||
if (preferences.contains("BackgroundColor")) {
|
||||
int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
|
||||
// Background of activity:
|
||||
appView.getView().setBackgroundColor(backgroundColor);
|
||||
try {
|
||||
int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
|
||||
// Background of activity:
|
||||
appView.getView().setBackgroundColor(backgroundColor);
|
||||
}
|
||||
catch (NumberFormatException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
appView.getView().requestFocusFromTouch();
|
||||
|
||||
Reference in New Issue
Block a user