Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Regular Contributor
marcossit
Posts: 86
Registered: ‎07-19-2012
My Carrier: Movistar-Venezuela

Help ActivityIndicator with Webview

Who could help me with a code webview + ActivityIndicator. When loading the page, I leave the indicator, but is removed when the page loads 100%.

 

IMG_00000034.png

 

I have that but it does not disappear when loading pa facebook page

Download my App for BB10 http://appworld.blackberry.com/webstore/content/134103/
Please use plain text.
Trusted Contributor
Brennan12325
Posts: 182
Registered: ‎05-15-2012
My Carrier: Telus

Re: Help ActivityIndicator with Webview

[ Edited ]

Lets see some of your code!

 

You should be connecting to the webviews loadProgressChanged SLOT similar to this:

connect(m_WebContent, SIGNAL(loadProgressChanged ( int )),
					this, SLOT(updateProgress ( int )));

 In updateProgress you would do something like this:

void YourClass::updateProgress ( int loadProgress )
{
if(loadProgress > 99.9f) {
//loading is done, don't need the SLOT anymore. disconnect(m_WebContent, SIGNAL(loadProgressChanged ( int )), this, SLOT(updateProgress ( int )));

//Loading is done, set the activity indicator to invisible. m_WebProgressIndicator->setVisible(false); }
//Update the indicator. m_WebProgressIndicator->setValue((int)loadProgress);
}

 I'm using a progress indicator, so you would not need to update the value at any point except when loading is finished, if you are using an ActivityIndicator instead.

 

If you're using QML here's a code sample.

You would do:

 

onLoadingChanged: {
    if (loadRequest.status == WebLoadStatus.Succeeded) {
        qDebug() << "Load finished.";
        idOfActivityIndicator.setVisible(false);
    }
}

 

----------------------
Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!
Please use plain text.