Application freezes upon opening; Phonegap warnings do not work

When I first launch my application from the main screen, everything works fine - without freezing.

When I use the application later, all of a sudden, when I click on it on the main screen, it sometimes freezes for 5 seconds (i.e. remains on the main screen) and then loads. This is not the end of the story.

The application does not freeze every time after the first download; however, as soon as it starts to freeze from the main screen, it will continue to do so until I stop the application.

After it freezes, some Phonegap features do not work. For example, navigator.notification.alert the background disappears, but the popup does not appear. The only way to exit is to click the back button.

How can I stop the application when it freezes when I open it, thereby disrupting the operation of other Phonegap functions?

(This is Phonegap 2.9.0, however I had the same problems 2.5.0)

All help is appreciated, thanks

+4
source share
1 answer

Adding

super.setBooleanProperty("keepRunning", false); 

right before super.loadUrl in your main .java file the file worked for me.

At the same time, because of the many (!) Hours of debugging, my application has an overload of “possible bug fixes”. I think the code above is a real fix, but here are some other changes I made:

Added to main .java file (before super.loadUrl ):

 super.setIntegerProperty("loadUrlTimeoutValue", 60000); 

Added to android manifest (in application tag):

 android:clearTaskOnLaunch="true" 

Edit:

Also, try using these options in your Android manifest:

 <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" /> 
+1
source

Source: https://habr.com/ru/post/1492715/


All Articles