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.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 10
Registered: ‎02-11-2013
My Device: 9900
My Carrier: airtel

Static image while web content is loading

Hello,

 

I want to display a static image while my app loads data from my web url. How to do it. Please someone help.

Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: Static image while web content is loading

Either look into a splash screen or into the DOMContentLoaded event in Webkit. You should display whatever you like until your page has completely loaded.

 

Splash screens API is here: http://developer.blackberry.com/html5/documentation/rim_splash_element.html

@erikjohnzon
erjohnson@blackberry.com
Contributor
Posts: 10
Registered: ‎02-11-2013
My Device: 9900
My Carrier: airtel

Re: Static image while web content is loading

Hi 

 

i implemented after searching a lot, but this is showing me two images of loading.gif, can you help my why..?

Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: Static image while web content is loading

What is showing you 2 images? Can you post some code or provided a more thorough expalantion.

@erikjohnzon
erjohnson@blackberry.com
Highlighted
Contributor
Posts: 10
Registered: ‎02-11-2013
My Device: 9900
My Carrier: airtel

Re: Static image while web content is loading

Hi this is my code,

 


GIFEncodedImage bitmapImage=(GIFEncodedImage)GIFEncodedImage.getEncodedImageResource("loading.agif");
image_field=new AnimatedGIFField(bitmapImage,Field.FIELD_HCENTER|Field.FIELD_VCENTER);
hfm = new VerticalFieldManager(USE_ALL_WIDTH|USE_ALL_HEIGHT) {
protected void sublayout(int maxWidth, int maxHeight) {
super.sublayout(Display.getWidth(), Display.getHeight());
setExtent(Display.getWidth(), Display.getHeight());
}
};

int padding = (Display.getHeight() - 16) / 2;
if (padding > 0) {
image_field.setPadding(padding, 0, 0, 0);
}

hfm.add(image_field);
add(hfm);
add(_browserField);

 

 

the screen displayed while data is getting loaded is showing two images, one and the other one over it. One is rotating while other one is static.