Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cordova-plugin-background-mode",
"version": "0.7.3",
"description": "Prevent apps from going to sleep in background.",
"version": "0.7.4",
"description": "Prevent apps from going to sleep in background. Support for capacitor",
"cordova": {
"id": "cordova-plugin-background-mode",
"platforms": [
Expand Down Expand Up @@ -38,4 +38,4 @@
"url": "https://github.com/katzer/cordova-plugin-background-mode/issues"
},
"homepage": "https://github.com/katzer/cordova-plugin-background-mode#readme"
}
}
13 changes: 12 additions & 1 deletion src/android/BackgroundModeExt.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,18 @@ public void run() {
try {
Thread.sleep(1000);
getApp().runOnUiThread(() -> {
View view = webView.getEngine().getView();

View view = null;

try{

view = webView.getEngine().getView();

}catch(Exception e){

view = webView.getView();

}

try {
Class.forName("org.crosswalk.engine.XWalkCordovaView")
Expand Down