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

Regular Contributor
Posts: 55
Registered: ‎09-01-2010
My Device: Not Specified
Accepted Solution

Screen navigation probelm

I have a Screen name  DownloaderScreen when the screen start it will start download some file and when download is complete it will go forward to next screen autometically. I using the following code.

    public DownloaderScreen() {
                    | USE_ALL_WIDTH);
            this.application = UiApplication.getUiApplication();
            HorizontalFieldManager outerBlock = new HorizontalFieldManager(USE_ALL_HEIGHT);
            VerticalFieldManager innerBlock = new VerticalFieldManager(USE_ALL_WIDTH | FIELD_VCENTER);
            innerBlock.setPadding(0, 10, 0, 10);
            phraseHelper = new PhraseHelper();
            final String[][] phraseList = phraseHelper.getDownloadList();
            gaugeField = new GaugeField("Downloading  ", 0, phraseList.length, 0, GaugeField.PERCENT);
            Thread dlTread = new Thread() {
                public void run() {
    private void startDownload(String[][] phraseList){
                for(int i=0; i < phraseList.length ; i++){//
                   // code for download    
    private void goToNext() {
    final Screen currentScreen = application.getActiveScreen();  
        if (UiApplication.isEventDispatchThread()) {  
            application.pushScreen(new HomeScreen());  
            } else {  
                application.invokeLater(new Runnable() {  
                    public void run() {  
                        application.pushScreen(new HomeScreen());  

The code is working fine and starts download files and when download is completed it is going forward to next screen. But when there is no file to download `phraseList` array length is zero, it is not going forward. What is problem in my code?

Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Screen navigation problem

Per haps the GuageField doesn't like going from 0 to 0? 


The easiest way to investigate this would be for you to debug the code and step through the processing for this case and see where it fails.  We are just guessing here.