Phonegap / Drupalgap / jQuery Mobile: Use "pageinit pageshow" events together to ensure functionality

Today I have an important note for you that cost me a lot of time and debugging my Drupalgap / Phonegap App using jQuery Mobile.


I had used the "pageshow" event:

Which worked great in my browsers tests!


On Android (build using build.phonegap) I had the strage problem that things were not working from time to time. As I finally found out the "pageshow" event was not always triggered. The reason is unclear and not reproducable. Sometimes it worked, sometimes not.


USe pageshow + pageinit:

Now things work cleanly.

PS: Keep in mind that you have to manually prevent double attaching and other stuff that may happen because the event may fire twice on a page load!


Post new comment

The content of this field is kept private and will not be shown publicly.

More information about formatting options