You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/04/23 20:41:07 UTC

[GitHub] [cordova-android] BekirBesli commented on issue #822: Back button event on full screen video closes application

BekirBesli commented on issue #822:
URL: https://github.com/apache/cordova-android/issues/822#issuecomment-825913968


   > > > > ## Thanks giuseeFG
   > > > > You will need to update app for this process.
   > > > > besides Instead of direct processing from here, you can direct it to an existing javascript function.
   > > > > @override
   > > > > public void onBackPressed() {
   > > > > this.appView.loadUrl("javascript:backexit();");
   > > > > return;
   > > > > }
   > > > > document.addEventListener('backbutton', backexit, false);
   > > > > function backexit(){
   > > > > ```
   > > > >  if (leftView.activePage.name != "student") {
   > > > >       if (document.webkitIsFullScreen == true) {
   > > > >           document.webkitExitFullscreen();
   > > > >      }else{
   > > > >              leftView.router.back();
   > > > >      }
   > > > > }else {
   > > > >    navigator.notification.confirm(translate.alert_message, app.onConfirm,  appName, 
   > > > >      [translate.no, translate.yes]);
   > > > >  }
   > > > > ```
   > > > > 
   > > > > 
   > > > > }
   > > > 
   > > > 
   > > > where to add this code??
   > > 
   > > 
   > > in the platform MainActivity.java file.
   > 
   > The listener and javascript function too?
   
   Hi; Just add below directory file.
   APP\platforms\android\src\com\company\appid\MainActivity.java
   regards.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org