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

Java Development

Reply
Contributor
Posts: 15
Registered: ‎09-13-2011
My Device: ccvb
My Carrier: dfdf

How to stop an Activity Indicator once the web page is loaded in BlackBerry Simulator.

Hi,

 

I have developed an application to access webpage in blackberry simulator and i wanted to show an Activity Indicator while loading the webpage its happening fine, but i want to stop an Activity Indicator once the home page is loaded, i am not able to do that please provide me the solution (code sample if available).

 

Please find the code below which i have deloped.

 

import net.rim.device.api.browser.field2.BrowserField;
import net.rim.device.api.browser.field2.BrowserFieldConfig;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.component.progressindicator.ActivityIndicatorController;
import net.rim.device.api.ui.component.progressindicator.ActivityIndicatorModel;
import net.rim.device.api.ui.component.progressindicator.ActivityIndicatorView;
import net.rim.device.api.ui.container.MainScreen;


/**
 * A class extending the MainScreen class, which provides default standard
 * behavior for BlackBerry GUI applications.
 */
public final class MyScreen extends MainScreen
{

    ActivityIndicatorView view = new ActivityIndicatorView(Field.USE_ALL_WIDTH);
    ActivityIndicatorModel model = new ActivityIndicatorModel();
    ActivityIndicatorController controller = new ActivityIndicatorController();
    /**
     * Creates a new MyScreen object
     */
   
     BrowserFieldConfig myBrowserFieldConfig = null;
     BrowserField browserField = null;
    
    public MyScreen()
    {       

                view.setController(controller);
                view.setModel(model);

                controller.setModel(model);
                controller.setView(view);

                model.setController(controller);       

               
                Bitmap bitmap = Bitmap.getBitmapResource("spinner.png");
                view.createActivityImageField(bitmap, 5, Field.FIELD_HCENTER);
                 add(view);
          
             
                //setTitle("Supplier eLink");
                myBrowserFieldConfig = new BrowserFieldConfig();   
                browserField = new BrowserField(myBrowserFieldConfig);
 
                 //browserField.requestContent("http://www.google.co.in");
                browserField.requestContent("http://203.101.92.152:8090/TestPapaSV/");                              
                add(browserField);
   
    }
}

 

 

Thanks

Rajesh

 

 

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: How to stop an Activity Indicator once the web page is loaded in BlackBerry Simulator.

Have a look at the article below for a sample for this.

 

How to track progress of page loads in your BrowserField2 application

http://supportforums.blackberry.com/t5/Java-Development/How-to-track-progress-of-page-loads-in-your-...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker