简体   繁体   中英

Prevent Phonegap notification.navigator popups from closing from touch outside of dialog

I am using Phonegap to build an Android application and am running into problems using functionality that is not well documented for Phonegap.

navigator.notification.activityStart('title', 'message');

The above works fine, and using it with activityStop() opens and closes the loading dialog when I need it to. The problem is that if the user touches the screen or hits the back button the loading dialog closes. I want it to remain open until I am done loading a document from a server in the background.

I am running into the same problem with navigator.notification.alert and the other functions of the navigator.notification .

Also, I would prefer to not modify any native code. I know that I could probably edit the Phonegap plugin native code to achieve this, but this application will eventually be cross-platform so I would prefer to not do any native code if possible.

I found a solution which I integrated in my application and it worked.

In java file of notification alert do the following change :

=> go to alert ()
=> dlg.setCancelable(false);

Good luck

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM