Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7724393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:40:38+00:00 2026-06-01T04:40:38+00:00

I have a Screen name DownloaderScreen when the screen start it will start download

  • 0

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() {
        super(NO_VERTICAL_SCROLL | NO_HORIZONTAL_SCROLL | USE_ALL_HEIGHT
                | 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);
        outerBlock.setBackground(BackgroundFactory
                .createBitmapBackground(LangValue.dlBgimg));
        outerBlock.add(innerBlock);
        add(outerBlock);

        phraseHelper = new PhraseHelper();
        final String[][] phraseList = phraseHelper.getDownloadList();

        gaugeField = new GaugeField("Downloading  ", 0, phraseList.length, 0, GaugeField.PERCENT); 
        innerBlock.add(gaugeField);

        Thread dlTread = new Thread() {
            public void run() {
                startDownload(phraseList);
            }
        };
        dlTread.start();

    }

private void startDownload(String[][] phraseList){

        if(phraseList.length!=0){

            for(int i=0; i < phraseList.length ; i++){//
               gaugeField.setValue(i);
               // code for download 
            }
        }
        goToNext();
    }

private void goToNext() {

final Screen currentScreen = application.getActiveScreen();  

    if (UiApplication.isEventDispatchThread()) {  
        application.popScreen(currentScreen);  
        application.pushScreen(new HomeScreen());  
        } else {  
            application.invokeLater(new Runnable() {  
                public void run() {  
                    application.popScreen(currentScreen);  
                    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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:40:39+00:00Added an answer on June 1, 2026 at 4:40 am

    The GuageField doesn’t like going from 0 to 0. When the length is zero, don’t add GuageField.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let say I have a screen name ITEM thats performs different actions: Save, Update,
I have a text file in JSON format that I downloaded using code from
I have written the following Midje test: (fact (followers-minus-friends ...name...) => [Dude] (provided (idset
I want to count re tweets counts for different screen name using single access
I have written this metamodel in a xText project: Screen: Screen name: name =
In selection-screen, I have one parameter called 'Author' I have called the report using
I have the following table: $sql = CREATE TABLE received_queries ( sender_screen_name varchar(50), text
I have 9 screen coordinates, each representing one of 9 positions. From the top
i have a screen and it is i want the buttons to put under
I have search screen which has 10 fields and involves around 5 to 6

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.