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 6712119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:13:20+00:00 2026-05-26T08:13:20+00:00

I make code to Blackberry Storm. When my application in horizontal display (480×360), it’s

  • 0

I make code to Blackberry Storm. When my application in horizontal display (480×360), it’s work. But when the Blackberry tilt into Vertical (360×480), the picture is cut off. So I was asking how to set up so that at the time of rotation, also resize the picture? is there any method to check if BlackBerry again horizontal or vertical display?

Thanks.

  • 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-05-26T08:13:20+00:00Added an answer on May 26, 2026 at 8:13 am

    Here are two things, either you will lock screen orientation or you will support in your application.

    Code sample: Retrieving screen orientation

    switch(Display.getOrientation()) 
    {
       case Display.ORIENTATION_LANDSCAPE:
          Dialog.alert("Screen orientation is landscape"); break;
       case Display.ORIENTATION_PORTRAIT:
          Dialog.alert("Screen orientation is portrait"); break;
       case Display.ORIENTATION_SQUARE:
          Dialog.alert("Screen orientation is square"); break;
       default:
          Dialog.alert("Screen orientation is not known"); break;
    }
    

    Code sample: Forcing portrait view in a BlackBerry API application

    // Use code like this before invoking UiApplication.pushScreen()
    int direction = Display.DIRECTION_NORTH;
    Ui.getUiEngineInstance().setAcceptableDirections(direction);
    

    You you want to handle the images and other graphics setup on orientation change then you can do the following changes in your code.

    1. Override the sublayout method, in your MainScreen subclass.

      protected void sublayout(int arg0, int arg1) {
      // do all the
      super.sublayout(arg0, arg1);
      }

    2. Check for the orientation changes, rearrange the UI. Usages of relative layout is recommended for such things.

    Hope, this might help you out. For more info visit Specifying_display_direction_of_screen

    Edit: override sublayout() and then write the code specific to orientation

    public void sublayout(int width, int height) {
        switch(Display.getOrientation()) 
            {
               case Display.ORIENTATION_LANDSCAPE:
                  // write the piece of code for refreshing the screen UI which screen orientation is landscape
                  break;
               case Display.ORIENTATION_PORTRAIT:
                   // write the piece of code for refreshing the screen UI which screen orientation is portrait
                   break;
    
            }
      super.sublayout(width, height);
    }
    

    Edit 2:

    you were going wrong because of UI event lock, now you do the following changes to your code.

    public void sublayout(int maxWidth, int maxHeight) {
                int displayWidth = deviceWidth;
                int displayHeight = deviceHeight;
    
                switch (Display.getOrientation()) {
                case Display.ORIENTATION_LANDSCAPE:
                    UiApplication.getUiApplication().invokeLater(new Runnable()
                    {
                        public void run()
                        {
                            Dialog.alert("Screen orientation is landscape");
                            // here you need to change your uI code as you want to do in for landscape mode
                            // you may need to delete and add the UI comps manually
                            // if the components added to absolute layout then just refresh the screen it will auto adjust with your new screen size 
                        }
                    });
    
                    break;
                case Display.ORIENTATION_PORTRAIT:
                    UiApplication.getUiApplication().invokeLater(new Runnable()
                    {
                        public void run()
                        {
                            Dialog.alert("Screen orientation is PORTRAIT:");
                            // here you need to change your uI code as you want to do in for PORTRAIT mode
                            // you may need to delete and add the UI comps manually
                            // if the components added to absolute layout then just refresh the screen it will auto adjust with your new screen size 
    
                        }
                    });
                    break;
                }
                super.sublayout(displayWidth, displayHeight);
                setExtent(displayWidth, displayHeight);
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can i make my code to work ? :) i`ve tried to formulate
How can I make this code work? class Meta @array = [:a,:b] def self.method_missing(name,
I want to make a code snippet database web application. Would the best way
Is there a way to make this code work? LogonControl.java @Audit(AuditType.LOGON) public void login(String
I make code to display multiple pages (max. 5 lines/page) with persons from one
I have one application in wich I need to make code changes almost all
i am new to Blackberry application development. now i am trying to make new
I want to make my application Blackberry in different languages. That mean I use
I want to use GCOV to make code coverage but the tests will run
I have make code to make directory on click event of button. But I

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.