Unable to detect the rotation of the device of the method of sublayout of screen

I'm developing an application compiled for OS 4.5. I need to find a way to detect the rotation of the unit and again fill the screen so that the fields are arranged according to the new dimensions.

My idea was to save the display width and height in some private variables in my case screen and method of sublayout overloaded screen, check if the new values have been changed.

What happens is that I get the old width and height again and again.

I first read this post. In this document, @arkadyz points out how the order of the calls is a little weird and values returned by the view class are updated after sublayout is finished.  Therefore, there is no way to detect by the sublayout method.

The proposed solution is to check the dimensions of the display within an invokeLater. Here's my test code:

public class TestScreen extends MainScreen {

    public TestScreen(){
        super(Manager.NO_VERTICAL_SCROLL);
        populateScreem();
    }

    private void populatescreen(){
        deleteAll();
        //fields and containers added here. No need to add any to observe the issue.
    }

    public void sublayout(int width, int height){
        super.sublayout(width,height); //Tried calling this in the last line as well with identical result.     

        System.out.println(">>>>>>>>> Display.getWidth(before): " + Display.getWidth());
        System.out.println(">>>>>>>>> Display.getOrientation(before): " + Display.getOrientation());
        System.out.println(">>>>>>>>> Width argument value (before): " + width);

        UiApplication.getUiApplication().invokeLater(new Runnable(){
            public void run() {

                System.out.println(">>>>>>>>> Display.getWidth(later): " + Display.getWidth());
                System.out.println(">>>>>>>>> Display.getOrientation(later): " + Display.getOrientation());
            }
        }, 1000, false); //Playing with the time parameter does not change behavior.
    }
}

This gives exactly the same results. After that, I came to this post where @peter_strange

provides a solution based on pushing a dummy screen, which detects the new width and height, and then passing the new values to the previous screen. I also tried, but it didn't work either.

I also tried using the obsolete Graphics.getscreenWidth instead of Display.getWidth, and it did not work.

Now, I am out of luck because I have almost tried everything and I can't provide a solution without resorting to the 4.7 or 6.0 API.

Tested in BB 9550 Simulator v5.0.0.535 (Platform 2.13.0.108) and v5.0.0.306 real unit BB 9520 (Platform 4.2.0.113)

Take a look at the following.  In my view, the following code can be used to detect changes in orientation.

public class TestScreen extends MainScreen {

    int currentDisplayWidth = Display.getWidth();
    int currentDisplayOrientation = Display.getOrientation();

    public TestScreen(){
        super(Manager.NO_VERTICAL_SCROLL);
        populatescreen();
    }

    private void populatescreen(){
        deleteAll();
        //fields and containers added here. No need to add any to observe the issue.
    }

    public void sublayout(int width, int height){
        super.sublayout(width,height); //Tried calling this in the last line as well with identical result.     

        System.out.println(">>>>>>>>> Current sublayout width (before): " + currentDisplayWidth);
        System.out.println(">>>>>>>>> Display.getWidth(before): " + Display.getWidth());
        System.out.println(">>>>>>>>> Display.getOrientation(before): " + Display.getOrientation());
        System.out.println(">>>>>>>>> Width argument value (before): " + width);
        if ( Display.getWidth() != currentDisplayWidth ) {
            // process orientation change
            // ....
            // Now reset change detection variables.....
            currentDisplayWidth = Display.getWidth();
            currentDisplayOrientation = Display.getOrientation();
        }
    }
}

Tags: BlackBerry Developers

Similar Questions

  • Kodak esp5250 printer 3520 error code unable to detect the edges of paper

    error code Kodak esp5250 printer 3520 unable to detect the edge of the paper?

    Please see

    http://support.en.kodak.co.uk/app/answers/detail/a_id/25352/kw/3520/selected/true .

  • HP PhotoSmart C4450 All in One Printer is unable to detect the alignment (tried everything) page

    My question is very simple. I tried all the options I could think for my printer detect the alignment page and it is still unable to detect the page. Can someone who has had the same problem please send me a list of recommended procedures to solve the problem? I intend to go through one by one until it is resolved. The post that I found with this exact topic didn't have a sufficient response that other that the user placed a bunch of papers on the page alignment and the printer worked... Could really use some help, my patience is pretty much exhausted. I use a MAC Leopard operating system. Thank you.

    Hi drubio1989,

    What are the levels of ink in each cartridge?  I connected a troubleshooting document that addresses the lack of alignment.  Click here  You could take a look and perform one of the steps that you did not.  Let me know how it goes.

    Good luck!

  • Oracle Forms Win 7 64 - bit error INST-07407: unable to detect the platform of the machine or pieces of JVM


    I'll try to install Oracle Forms 11.1.2.0 on Win 7 64 bit and get INST-07407: unable to detect the platform of the machine or the pieces of the JVM.

    I followed the steps described in Oracle Forms 11.1.2.0 on Win 7 64 - bit bit JVM error but still unable to solve my problem.

    Here are the details of the version of the installed JDK.

    C:\Program Files\Java\jdk1.6.0_45 > java-version

    Java version "1.6.0_45".

    Java (TM) SE Runtime Environment (build 1.6.0_45 - b06)

    Java for 64-bit Server VM (build 20.45 - b01, mixed mode)

    C:\Program Files\Java\jdk1.6.0_45 > % java_home Echo%
    C:\Program Files\Java\jdk1.6.0_45

    C:\Program Files\Java\jdk1.6.0_45 > echo %path%
    C:\Windows\System32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows; C:\Program Fi
    les\Java\jdk1.6.0_45\bin

    Installer: -.

    1 jdk-6u45-windows - x 64

    2 wls1036_generic.jar for 64-bit platform

    3 ofm_frmrpts_win_11.1.2.0.0_64_disk1_1of1

    Please advise. Thank you.

    I don't know if help.

    I have installed Oracle Forms 11 g on Windows Vista Home Edition (64-bit), had been an experience horrible (much testing), although eventually I got.

    If I'm not mistaken, I used this guide:

    Oracle WebLogic & Forms 11g Release 2 installation guide

  • Imaging software unable to detect the scanning device

    I installed an Epson Perfection V700 Photo scanner as well Silverfast 8 SE who works with the scanner.  It used to work fine, but now when I start it, it says it cannot detect a scanner.  I uninstalled the scanner and Silverfast several times but the problem persists.  When I check device for devices showing Manager, there is no icon for the Scanner.  I consulted Silverfast support but so far nothing of their suggestions help.  It's as if the scanner is installed in a place that is not detected either by Silverfast or Device Manager.  The scanner works fine regardless.

    Hope you can help.

    Jim

    Hello Jim,

    I'm glad to know that you have addressed the issue.

    Your efforts to solve this problem is appreciated. We appreciate the time taken by you to share the resolution. I don't know that it would be beneficial to other members of the community as well.

    Please do not hesitate to answer, in the case where you are facing in the future other problems with Windows.

    Thank you

  • Stupid MS is unable to detect the operating system of W2KPSP4 but sees IE6SP1 user agent

    It is ridiculous that Microsoft (coding of Web Pages webmaster) is unable to detect that a user entering the page has a (drop dead) of Windows 2000 Professional SP4 operating system (OS)...

    and then always recommend (MS) install IE 8... When as far as I know... an IE8 installation cannot complete successfully on the OS W2KPSP4?

    Hello

    The Microsoft Answers community focuses on the context of use. Please reach out to the business community of COMPUTING in the TechNet forum below:

    http://social.technet.Microsoft.com/forums/en-us/categories

  • Linksys wireless-g usb network adapter unable to detect the router using windows XP desktop PC

    I've changed in broadband Orange yesterday and since then my adapter is unable to find the network (it was working fine with TalkTalk until I changed).

    He managed to find a couple of other networks that are nearby but nothing else.

    I have a laptop (windows 7) who finds the router Orange immediately. I tested the adapter with the laptop and it finds the router Orange plus about 10 other nearby networks.

    I rang Orange who crossed their tests and not found any problems. I uninstalled and reinstalled the adapter on the windows XP desktop, but I get the same result.

    Can anyone help?

    Thank you

    Thanks for the reply.

    I got it finally work last night after a day of cleaning up!

    Even if the network does not have to be detected in the available wireless networks "choose" I tried the "New Connection Wizard" and entered all the details that came with the router. The adapter found the Orange router but nothing else in the region.

    For now, it works but there is a problem somewhere, because I don't see any networks, I can see on my laptop.

    See you soon.

  • WRT110 Wireless - unable to detect the signal/connection.

    Recently lost connectivity to an existing wireless connection I had set up over the past months.  The two XP laptop with Dell Wireless WLAN Card and box of Wii is no longer connect or detect the signal.  Curiously, WiFi stood momentarily after the reset of power on the router but then disappeared. I connect well with connection wired and mobile detects all my neighbors SSID.  All the lights on the router are bed... but no wireless signal.  I even joined a wireless USB device to my desktop pc to test.  It detected all the SSID of the neighbors but not mine.  Even with the laptop.

    Troubleshooting steps I did:

    -Router-

    Power recycled.

    Held reset button.

    Linksys firmware to 1.0.5 update

    Configuration is modified to enable the SSID Broadcast

    -Laptop-

    Card driver WLAN Dell upgrade vA17 4.170.5 to 4.170.77.18 vA22

    People with disabilities Dell Wireless utility and enabled Windows Wireless configuration.  Either the Dell or Windows detected my wireless signal wireless utility.  Both will detect AND connect to the open connection of the neighbor.

    Appreciate any idea or other troubleshooting suggestions.

    Readjust the settings of your router wireless...

    Open an Internet Explorer browser on your computer (desktop) wired page. In the address bar type - 192.168.1.1 and press ENTER... Let the empty user name & password use admin lowercase...

    For wireless settings, follow these steps: -.
    Click on the Wireless tab
    -Here, select manual configuration... Wireless network mode must be mixed...
    -Provide a unique name in the name box of the wireless network (SSID) in order to differentiate your network from your network of neighbors...
    -Set the Standard - 20 MHz Radio band and change the Standard channel to 11-2, 462 GHz... Wireless SSID broadcast should be enabled and then click on save settings...
    Please take note of the name of the wireless network (SSID) because it's the network identifier...

    For wireless security: -.
    Click the sub-tab under wireless > Wireless Security...
    Change the mode of WEP wireless security, encryption must be 64-bit. Let the empty password, do not type in anything... Under type of WEP Key 1 in all 10 numbers please (numbers only and no mailbox for example: your 10-digit phone number) and click on save settings... Please note the 1 WEP key as it comes to the security key for the wireless network...

    Click the settings advanced wireless
    Change the interval of tag to 75 > change the Fragmentation threshold to 2304, change the RTS threshold to 2304 > click 'save settings '...
    Now let's see if you can locate your wireless network and try to connect...

  • ESXi is unable to detect the discs.

    Hi, I am running esxi 6 and the difficulty to detect the discs. ESX just see them quite so that a live disc ubuntu can. I have an ssd and 2 hard drives connected via an adaptec 6405 contoller card of their own individual JBOD, this is a configuration that works on two of our other servers. I tried re-initialization of disk and rebuild partition table in gparted, but nothing seems to work. Any ideas?


    RAID controller http://www.VMware.com/resources/compatibility/detail.php?deviceCategory=IO & productid = 20867 & deviceCategory = io & details = 1 & partner = 475 & releases = 273 & keyword = 6405 & page = 1 & display_interval = 10 & sortColumn = Partner and sortOrder Asc


    Driver is installed


    Here is the map on HAL: VMware Compatibility Guide: search for i/o device

    Here are the 6 version https://my.vmware.com/web/vmware/details?downloadGroup=DT-ESXI60-PMC-AACRAID-62140709&productId=490 ex

    R

  • "Unable to detect the Service" - bluetooth mouse connects is no longer

    Recently reformatted my c: drive, have a Sony Vaio running windows xp and it has upgraded to SP3.  Tested connection Sonyerisson Xperia Sony headphones via bluetooth and the two connect very well.  Have uninstalled and reinstalled Toshiba Bluetooth stack and nothing.  He sees the mouse but gives the error "failed to detect the service."  Also see "Bluetooth Local COM" in the Panel does not register the blue tooth services, more they are not in the registry.  I had been using the mouse before reformat, so not sure what happened.

    Hello KMXperia,

    Thank you for your message.  Please click HERE for some troubleshooting process.  After running these steps, please let us know how you feel.  We can't wait to hear back on your part.
    See you soon

    Engineer Jason Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

  • 4 iPad unable to detect the C4599 already connected to the wireless network printer

    Hi all, I have a C4599 All in One Printer. I have just set up successfully with a WiFi connection to my router / modem network (infrastructure mode). There is no error message and I can print from a variety of laptops Windows (XP, Vista and 7). I loaded the HP eprint app on my Ipad 4 but it can not detect the printer. Note that the HP site says that this printer is compatible with the App ePrint.

    A second and possibly related is that I recorded with the HP eprint service website but I can't get the code or e-mail address for my printer. I can't find any way to turn it on the Web Services on the printer? (The HP site says this should be under Setup > wireless to the printer, but it is not.) There are only options to turn on/off the wireless, testing the wireless and print the wireless network and printer settings (which are all OK > PASS or information).

    Any ideas?

    Thank you

    With the update that has been done to the ePrint application, some of the old printers lost the ability to use this application to print from. The printer would not print directly from the iPad to the printer either. This is a feature called AirPrint. When you have the possibility to use AirPrint, he must place the unit on the same network as the printer, pull up a photo, press the action button on the iPad and then select print. The iPad will then give an option of the printer to print from if there is more than one printer capable of of AirPrint on the network.

    The printer cannot produce a code to register and save ePrint due to the age of the printer. Printers that have the ability of ePrint are a majority of those who have been in production in 2010 and later versions. A few Photosmarts who have the ability to use ePrint AirPrint are the 7520,6520 and the 5520. To learn more about these printers, see this link here.

  • "Unable to detect the remote device" Bluetooth re Nokia phone

    I have two Nokia phones and can not connect to my laptop Toshiba Tecra via bluetooth

    I am running XP SP3
    V6.10.10 (T) battery Toshiba BT
    Nokia PC Suite 7.0.8.2 version

    Information system in Nokia PC suite pointed out two stacks of BT compatible:
    Microsoft Version 5.1.2600
    Toshiba 6.0.7y19.0
    The help of Nokia says "If your Bluetooth software is not supported by Nokia PC suite, this is mentioned in the information of Nokia PC suite window"
    There is no indication in the information of Nokia PC suite window that my Bluetooth software is not supported.

    I constantly receive a "cannot find the remote device" message when you use Toshiba BT Stack.

    I put my permananently visible to all Bluetooth phones and fortunately they send information to each other.

    For a few seconds, one of my phones connected using the Launcher free config (not something I normally use) but then the phone has disappeared from the screen and now can not be detected.

    I tried
    -turn on and off again;
    -connection by using the Nokia PC Suite application
    -connection by using the BT stack
    -connection using free config
    Without success.

    Any ideas?

    Maybe that your antenna has release the Bluetooth module so that your Bluetooth range is very limited.
    Can you try to move your mobile phones very close to your laptop and the search for your bluetooth phones?
    What is the result of the diagnosis function? :
    (right-mouse click on the Bluetooth icon in the systray-> Options-> Diagnostics-> Run (verification tests))

  • Satellite L50 - A - unable to detect the remote device on BT

    Hello

    I have a C50-A-1E9 Satellite, I bought with Windows 8.1 and it downgraded to Windows 7 change HARD for one SSD drive.

    Everything works fine except Bluetooth.
    I have an Atheros AR956x wireless network card.

    Already reinstalled battery bluetooth several times, also with the installation of Package before Bluetooth filter driver (here I do not know if the installation worked, because I do not receive a "Installation complete" message, but no error message no more).

    The Bluetooth Manager, and everything seems fine.
    Just that I can't find other devices when I try to add new connections (tried several of them - speakers bose, galaxy S2) and devices do not see my computer.

    It seems that my computer think Bluetooth works, but in fact it doesn't.

    You have ideas, what's not here? Thank you in advance!

    I don't have experience with this machine, but by the use of BT is important the BT module is successfully activated. To do this, as far as I know, you use the FN key combination.
    Issues related to the:
    You can use the FN keys in general?
    When you press the FN key you find at the top of your screen flash cards?
    You can use FN + F12 key combination?

  • Windows XP Pro unable to detect the USB mass device

    Original title: USB

    I have a Western Digital ("My Passport Essential" WD3200ME) portable mass memory. My PC is running XP Pro with all the latest news from the security of Ms. In the last year or two, I noticed that it becomes progressively difficult for XP to recognize my USB mass storage device - sometimes, he took a reboot and repeated the reconnection of the device before the device is recognized. MS updates, the more difficult this because to make a connection. When it fails to connect, I get this annoying Hardware Wizard, which constantly to appear, asking Windows to search for the correct driver. I also have an old Pro XP PC I have installed all the updates latest MS, but it has XP SP3 installed. The old PC has no difficulty to recognize and connect to the same USB mass storage device. So I have 2 PC Pro XP: does not work with the latest updates from MS that gives connection problems to my USB mass storage and the other XP Pro base. Even if I bought another USB mass storage, it would probably suffer the same problem. What do you think is the problem?

    One of the best USB debugging of sites I've come across is this:
       <>http://www.Uwe-Sieber.de/usbtrouble_e.html >
    Go about 1/2 to the bottom of the page and look for the section titled: "application for XP drivers.  Most likely, you just need to delete the file "infcache.1" and let it rebuild.

    HTH,
    JW

  • MAX is unable to detect the webcams

    I have three different webcams. Two of them worked in MAX and LabVIEW. When I tried to install the third argument, everything stopped working.

    I think the problem was perhaps a database corrupted - I received the following error message:

    http://digital.NI.com/public.nsf/allkb/7FF79722720AEE488625759B0074A2CA?OpenDocument

    I followed the steps listed on this page, which did not solve the problem.

    I then reinstalled MAX and LabVIEW, and this has not solved the problem either. Or MAX no LabVIEW can 'see' one of the three webcams.

    All three are standard webcams and should be detectable by LabVIEW. I use LabVIEW 8.6 with Vision Acquisition 8.6 and IMAQdx.

    Webcams are all series:

    -HP Webcam (integrated in the laptop, not sure type bus)

    -Logitech Quickcam

    -Microsoft Lifecam

    The three cameras work on this computer - they work very well with their Aboriginal viewers. The first two worked fine before LabVIEW.

    Is there a way I can * force * MAX to recognize these devices?

    Vision acquisition 8.6 does not support DirectShow/USB cameras. Which has been added in 2009. I'm guessing that you have a newer version already installed? I would say go and grabbing the latest version here:

    http://Joule.NI.com/nidu/CDs/view/p/ID/1641/lang/en

    Eric

Maybe you are looking for

  • channel search

    Hello I'm programming an application in LV7.0.  The app is an extension of a previous application, and I need to find where strings are used throughout the program.  How do you search for a string in a vi and all sub vi, for a given application? Than

  • Advanced search function (search for filter)

    Hello world I'm new to LabVIEW! I installed LabVIEW 11. Someone know how to filter files in a path (filter model) tables? I could list only all the files in the folder. I need to filter all my files and display only files with 'XY_MULTI-TILE' in them

  • change xp on asus laptop of Dutch in English

    I bought an asus laptop used all there in Dutch xp I can't change English

  • The wireless adapter question

    I need a wireless adapter for my old desktop PC.  I think the WMP54G.  Old desktop has XP Pro.  Base of PC has Vista Ultimate.  Router is a WRT54GL.  Network is WPA2 encrypted.  I should have no problem, another adapter would be more appropriate?  Th

  • system crashed, I need to select the first boot device in the boot menu...

    my computer crashed and has a black screen I have reboot by pressing F8 and then to the start menu What now?  Press and hold f8 at startup takes me the blue screen with 3 options 1) esc = boot menu 2) f10 = set up 3) f11 = system restore.  I don't ha