UjjawalKr
UjjawalKr

Reputation: 241

To display loader image while loading the next page in phonegap android application

I am developing a phonegap android application which consists of three html pages.Each page have some dynamic data that loads on page initialization. I want to display a loader image on the click of a button to navigate to other html page while loading it.

How can i implement this? Is there any default function for this ?

Upvotes: 1

Views: 12893

Answers (3)

Ashisha Nautiyal
Ashisha Nautiyal

Reputation: 1397

for android use

 navigator.notification.activityStart

for detail check this

show-loading-screen-in-phonegap-app

Upvotes: 0

Suhas Gosavi
Suhas Gosavi

Reputation: 2170

Above answer is also good there is another option manually you have to create one div on each HTML page like

 <div id="pageLoader">
    <div>
       <img src="images/ajax-loader.gif" /> // give here path of any loader image you want
    </div>
 </div>

then call $("#pageLoader").show() and $("#pageLoader").hide() wherever you want to show and hide loading.

Upvotes: 3

Dom
Dom

Reputation: 2569

Documentation found here.

function showSpinner(){
    $.mobile.loading("show");
}

function hideSpinner(){
    $.mobile.loading("hide");
}

Upvotes: 6

Related Questions