Merge pull request #750 from goffioul/patch-1

Don't request focus explicitly if not needed
This commit is contained in:
Darryl Pogue 2019-08-28 15:31:25 -07:00 committed by GitHub
commit c93e3e9f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -268,9 +268,11 @@ public class CordovaActivity extends Activity {
if (this.appView == null) {
return;
}
// Force window to have focus, so application always
// receive user input. Workaround for some devices (Samsung Galaxy Note 3 at least)
this.getWindow().getDecorView().requestFocus();
if (! this.getWindow().getDecorView().hasFocus()) {
// Force window to have focus, so application always
// receive user input. Workaround for some devices (Samsung Galaxy Note 3 at least)
this.getWindow().getDecorView().requestFocus();
}
this.appView.handleResume(this.keepRunning);
}