Blocking rotation of the screen - 4.6.1 SDK

Follow the latest code I did:

What's up guys!
I'm trying to run an application on curve 8520 and tourch 9800, so I use sdk4.6.1.
I would block the rotation of the screen on the torch, but I know that the 4.6 SDK is no such API. I tried to override the paint method and invalidate sublayout, trying to put the paintSuspend as true.
I need, in addition to block rotation, ask the user to return to the correct orientation (portrait), but dialogue does not work.

My last code below:

public final class MyScreen extends MainScreen {
 ...
 public void invalidate() {
        String deviceName = DeviceInfo.getDeviceName();
        int width = Display.getWidth();
        int height = Display.getHeight();

        System.out.println("diogo ------------display: " + width + " " + height + " name" + deviceName);

        if (width == 480 && height == 360 && deviceName.equalsIgnoreCase("9800")) {

            synchronized (UiApplication.getEventLock()) {

                loadingDialog.setEscapeEnabled(false);
                loadingDialog.doModal();

                UiApplication.getUiApplication().suspendPainting(true);
                System.out.println(UiApplication.getUiApplication().isPaintingSuspended());

                return;

            }
        } else {
            if (UiApplication.getUiApplication().isPaintingSuspended())
                UiApplication.getUiApplication().suspendPainting(false);
            loadingDialog.close();
        }
        super.invalidate();
    }
}

Might be easier to upgrade your 8520 for OS 5.0!

I looked at your code seriously not, but invalid do seems to be a dangerous place to do so.

I'd do it in sublayout.  sublayout is called when the rotation is detected.

If you detect a rotation, then to sublayout, create an invokeLater (you will not be able to do this kind of thing in sublayout, you must start a new process).  The invokeLater push a new screen of your production.  In sublayout of the screen, check the orientation by using the width and height.  When that detects the correct orientation. have pop himself (in another invokeLater.  I think it should work and hooks in a defined place.

Ask if this is not clear.

Tags: BlackBerry Developers

Similar Questions

  • Rotation of the screen with Automator and a script

    I have no knowledge whatsoever about scripts, coding or automator. I continue to read discussions about the issue, but I don't understand them. It would be a great help for me if someone please explain how to create a kind of keyboard shortcut that changed the rotation of the screen (the own macbook screen, not an external) using automator and a script on a Macbook Air running OS X El Capitan 10.11.2.

    Is this possible?

    Thank you in advance.

    One option is to use the utility command line fb - turn in Automator service and assign a keyboard shortcut. Download the GitHub source fb-rotation, compilation, following the indications on GitHub and output the binary to usr; or download a binary compiled and move to usr/local/bin.

    Create an Automator service, set the options "Service receives no entry in any application", add an action to run the Shell Script and set the options as "Shell: / bin/bash ', ' Pass entry: to stdin.  Type the command rotation fb for the desired degree of orientation of the screen such as ' / usr/local/bin/fb-rotation - d 0 - r 180 ' 180 ° on the main screen. Register the service under a name.

    Go to  > System Preferences > keyboard > shortcuts > Services. Highlight the service you created, select it, click "none" and create a shortcut using a unique combination of keys. Create separate services of Automator for the additional screen orientations. Quit the system preferences when you are finished.

    Tested with OS X 10.10.5 Yosemite and El Capitan 10.11.3

  • Set the rotation of the screen to external monitor on Portege M400

    I would like to be able to use the screen of the mobile phone in the form of tablets, while the display to an external monitor. The problem is that when you use the laptop in its Tablet configuration (fixed and swivel screen on top) the external monitor displays the image upside down. If I rotate the screen image output, so I use the Tablet upside which is impossible when it is docked. Is it all the same independently set the rotation of the screen of the Tablet and the external screen?
    If someone could help me with this I would be grateful as at this moment whether or not I have to remove the Tablet and use backwards the external monitor.

    I use Windows tablet PC on a Portege M400 and a monitor external 22 "LCD

    Thank you.

    Before we start the discussion I just have one question: do you want to use extended desktop or office cloned on external monitor?

  • Portege M400-146: Rotation of the screen after disconnecting

    Does anyone noticed a problem where, after disconnection and switch to Tablet mode, the screen rotation button doesn't seem to work correctly?

    What do you mean with doesn't seem to work correctly?
    What happens when you use this button after disconnection and switch to Tablet mode?

  • HP Envy 13-j001ng 2 X: no rotation of the screen after updating Windows 10

    Hello

    After the Windows 10 update, the screen will not rotate automatically. Sensor apps tests show that they are working correctly. I have the rotation toggle lock in the notification Panel (I read that some people affected by similar problems don't have it). Any solution for now or should I just wait for updates?

    To solve the problem, I had to replace the pilot ODS sensor V2 with the Simple device orientation sensor driver. Now rotation works.

  • Yoga 3 11 no. Rotation of the screen after upgrade WIN10

    Hello world!

    I have just upgarde my Yoga 3 11, winning 8.1 to win 10. And the last number I have to solve when passage of the fashion tent/tablet support, the screen does not rotate, nor changes to Tablet mode.

    I hope to find a solution as soon as POSSIBLE!

    Thank you!

    Mod edit: editing the model name.

    Dear comrades!

    Problem solved! Just uninstall Transition... And my Yoga works perfectly!

    Thank you!

  • Jet 7 (5709) Auto Rotation of the screen does not

    What drivers or application is installed which allows the screen to rotate the mode landscape to portrait when the power is on? My screen is no longer made rotate and I believe that something can inadvertently uninstalled that has enabled this feature. I've updated / installed all three packages available on site support without luck?

    All of the drivers listed have been marketed on the site of Stream 7 downloads & drivers HPand are available for public download. Thank YOU HP support allowing the customer to self-help. This is a great little device SLEEP simple tasks.

  • BlackBerry Z10 rotation of the screen does not

    The screen on my brand new Z10 rotation does not work. Rotation lock is NOT on.

    I checked with the BBSensors app and the accelerometer, compass, magnetometer and Attitude sensors seem to not work.

    I tried several reboots - not good.

    The phone has crashed and rebooted several times itself (usually while he was in my pocket) - not good.

    Finally, I turned the phone in landscape orientation and he tapped firmly on an extended finger. Screen rotation! Since then, all sensors have worked and screen rotation continues to work. I would not believe him if someone told me but it's really what happened.

  • Rotation of the screen with virtual keyboard.

    Hey all, I am porting a no touch to work in touch devices, but the screen rotation throws me some curves that I can't find a good solution for. I have an image for the background of a screen. In the method of paint background vertical field Manager that holds everything, I check the current resolution and to draw the image appropriate for the portrait to landscape mode. This works well, as long as the virtual keyboard is hidden. I bring up the keyboard (of, say, by clicking in a text field) and the background image does not change (i.e. going from portrait to landscape leaves me with a white bar on the right side of the screen), and the fields have the same width and page layouts. Any advice?

    Ah ha! Long story short, Display.getHeight () returns the height of the screen, but if the virtual keyboard is displayed, its height will not appear in the getHeight() value.  This was causing problems with my orientation detection code.

    The strange display behavior was a result of me being too careful.  I put 'default' in all of my instructions switch during the original no touch development, so that when I don't add different resolutions, he displayed a screen that would be small, but grave not down.  I did not detect a known resolution and continued to display the portrait mode, but only while the keyboard was visible.

  • Angle of Rotation of the screen use + video problems

    Hi netpos,.

    Recently, I stumbled on the following problem with the video appearance on a portrait based on the Lcd screen.

    So, I ve set the DMP to rotate the screen 90 degrees to fit the current orientation of the LCD screen.

    Presentations that have images, swf are looking really good. But, if the presentation includes a video file, then the video file does not turn with the rest of the presentation but is presented in landscape orientation (such that it appears the LCD screen was mounted in landscape orientation).

    The current solution to do this is to modify (using the video editing) the video and turning at 90 degrees. Then everything seems ok.

    But, in doing so, the whole appearance of the video is reduced and also, time is lost as well!

    If anyone has encountered this before?

    Thanks to you all

    Hello


    What you describe works as expected.  The DMP will NOT alter the video.

    If the video is the film in 'landscape' or 'big' screen, the video will be played

    in the original mode, even if the display is shot in portrait mode.

    The video must be registered with mode\vertical portrait in mind.  If this is not

    the video will need to be changed via an application of part 3 to fit the dimensions of

    You vertical video object.


    If this answers your question, take the time to mark this

    discussion answered & rate the answer.


    Thank you!


    T.

  • Tecra A11 - 125 - deactivation of the rotation of the screen shortcuts do not work

    Dear users of the forum,

    I recently bought my new Tecra A11-125 online and so far I really like it!

    BUT: I work with a translation software where I need the shortcut Ctrl + Alt + arrow down quite often. This shortcut has been configured as an aid to turn the screen tilted up.

    I disabled the shortcuts under graphics properties (right click Desktop > graphics properties > shortcuts > disable). It worked fine the first day.
    The next day, I started the laptop and: the screen keeps turning up-side-down. I checked the settings and shortcuts are always disabled. Nothing seems to have changed... but I can't solve my problem... Strange, isn't it?

    Is it possible to disable these shortcuts?

    Thank you

    Lvho

    PS. I use Windows 7.

    Hmmm maybe you need to reinstall the graphics driver again
    The mentioned shortcut is a part of the software/driver for graphics card. It s not a feature of the Windows operating system. This is why I recommend to uninstall the driver for the graphics card first, and then after reboot again and cleaning of registry (using CCleaner) you could install the driver of graphics again.

    Welcome them

  • Windows blocked to disconnect the screen after trying to stop

    I put in this forum, as the other post was in the wrong forum.
    Windows Vista Home Edition on a HP desktop computer. I try to stop, and the rest of the computer with logging off the screen with the little circle thingy goes round and round. It doesn't go away until I have press and hold the power button for a while then turns off the computer. It will not stop by itself. When I restart it once I get it shut down with the power button, it gives me a screen saying windows was not shut down properly and gives me different choices on how to restart it. I choose start windows normally and windows starts fine, but will not be closed. It gets stuck at logging off the screen. What the heck is wrong?

    I did the boot, but that did not help either. I scanned with Adaware SE, but he found nothing. The computer would leave answering programs as long it has been used. I tried to install the updates for Vista which took forever because he would leave just to install the updates. Finally, after many trials and lots of swearing, I got all the updates that are installed and the HP updates. I installed AVG and it had to scan the computer. He found nothing. It seems that updates could have solved the problem.

  • How to detect the automatic rotation of the screen on the storm?

    Hello

    I'm trying to resize BitmapField change direction of the screen. But I don't know how to detect it.

    Can you help me?

    What class should I use to this problem?

    Thank you.

    Override sublayout on your screen in order to detect changes in orientation.

    public void sublayout(int width, int height)
    {
       // Your code here
       super.sublayout(width,height);
    }
    
  • (hp envy 13-j000na 2 x) does not auto-rotation of the screen after upgrade to windows 10

    I can put in power 'Rotation lock' and "tablet mode" in the center of the action, but this does not help.

    I have noticed that after the last MS updated (KB3093266), auto-rotation started working even after a restart of the tablet. In Device Manager, the device driver Simple guidance is installed. For the moment, I think my problem is solved.

  • Bug in the timer (small app). Reset during the rotation of the screen of the phone.

    I discovered that if you use the small standard timer app and do you rotate the phone (from portrait to landscape or vice versa) the app resets istantly. This happens even if minimize you it. Before I discovered, I thought several times, I was going crazy to forget each time put the timer.

    Please fix it I use it often while cooking!

    I have an E6883 Z5 double Premium

    It has been reported before

    http://talk.sonymobile.com/T5/Xperia-Z3/small-app-timer-not-working-on-Z3/TD-p/1036704/highlight/Tru...

Maybe you are looking for

  • top title bar controls right does not

    Using the version 10.0.1 with Win XP SP3 5.1. Firefox opens and seems to work fine, but the controls at the top right of the title bar do nothing. If I open the Windows Task Manager they then start to work and continue to work even after I closed the

  • Firefox 6.0 is not compatible with 1Password!

    Just upgraded to FF 6.0 and is not compatible with 1password 3.7.5 (latest version dated August 17, 11

  • Game compatibility

    Why your list of games that are windows 7 is compatible if small and with games that I have ever heard.  What is the list of incompatible biggest games? and why don't you show it. If you do not provide a list of popular games that are compatible, how

  • Update error Code 80070020

    Need help to solve this error code.  Can download, but can not install updates.

  • Change config for Active / Standby NSA 2600 for WAN to Sonicwalls?

    Hello I took possession of an installation of two 2600 of the NSA, and they are currently in a pair, but with the WAN goes directly into one of them. So I will try to get the router to go into the HP switch (2920) on a configuration of VLAN upward an