Activity indicator

Use an activity indicator to display a visual cue that a task whose duration is unknown is progressing. If you can calculate how long the task will take, consider using a progress indicator instead.

Class ActivityImageField
Supported since BlackBerry® Java® SDK 6.0
Example This screen shows an activity indicator.

For more information about activity indicators, see the UI Guidelines.

Code sample: Creating an activity indicator

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.progressindicator.*;
import net.rim.device.api.ui.container.*;

public class ActivityIndicatorDemo extends UiApplication 
{
    public static void main(String[] args)
    {
        ActivityIndicatorDemo theApp = new ActivityIndicatorDemo(); 
        theApp.enterEventDispatcher(); 
    }
    
    public ActivityIndicatorDemo() 
    { 
        pushScreen(new ActivityIndicatorDemoScreen()); 
    } 
}

class ActivityIndicatorDemoScreen extends MainScreen
{
    ActivityIndicatorView view = new ActivityIndicatorView(Field.USE_ALL_WIDTH);
    ActivityIndicatorModel model = new ActivityIndicatorModel();
    ActivityIndicatorController controller = new ActivityIndicatorController();

    public ActivityIndicatorDemoScreen ()
    {
        setTitle("Activity Indicator Demo");
        
        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);
    }
}

Next topic: Progress indicator
Previous topic: Gauge field

Was this information helpful? Send us your comments.