mirror of
https://github.com/apache/cordova-plugin-statusbar.git
synced 2025-02-07 23:32:54 +08:00
android: Fix StatusBar.initialize() not running on UI thread
This commit is contained in:
parent
d2f8b0b0a5
commit
92a4eaeab5
@ -43,15 +43,20 @@ public class StatusBar extends CordovaPlugin {
|
|||||||
* @param webView The CordovaWebView Cordova is running in.
|
* @param webView The CordovaWebView Cordova is running in.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
|
public void initialize(final CordovaInterface cordova, CordovaWebView webView) {
|
||||||
Log.v(TAG, "StatusBar: initialization");
|
Log.v(TAG, "StatusBar: initialization");
|
||||||
super.initialize(cordova, webView);
|
super.initialize(cordova, webView);
|
||||||
|
|
||||||
|
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
// Clear flag FLAG_FORCE_NOT_FULLSCREEN which is set initially
|
// Clear flag FLAG_FORCE_NOT_FULLSCREEN which is set initially
|
||||||
// by the Cordova.
|
// by the Cordova.
|
||||||
Window window = this.cordova.getActivity().getWindow();
|
Window window = cordova.getActivity().getWindow();
|
||||||
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes the request and returns PluginResult.
|
* Executes the request and returns PluginResult.
|
||||||
|
Loading…
Reference in New Issue
Block a user