Force the App in landscape

My application is a MIDlet. It only makes sense in landscape mode, so I want to force display only this way.

I found the following code snipplet:

DirectionControl dc = (DirectionControl) ((Controllable) Display.getDisplay(this)).
    getControl("net.rim.device.api.lcdui.control.DirectionControl");
int directions = DirectionControl.DIRECTION_EAST | DirectionControl.DIRECTION_WEST;
dc.setAcceptableScreenDirections(directions);

and according to the advice I put it just before the Display.setCurrent () in the constructor of my MIDlet. But the Simulator (9500) still does not care on this issue and fortunately shows the application in portrait mode. I don't have a real device to check at the moment.

So a question: it's supposed to work in the Simulator?

OK guys, a combination of messages * almost * works

(1) if I

dc.setAcceptableScreenDirections(DirectionControl.DIRECTION_EAST|DirectionControl.DIRECTION_WEST);

as stated in the original article, while the Simulator (9500 that comes with JDE 4.7) does not care about it at all.

(2) if I take the first Board and make

dc.setAcceptableScreenDirections(DirectionControl.DIRECTION_EAST);

Then, the situation improves a bit - the Simulator still does not automatically pass IS when I run my application and does NOT fire a sizeChanged() event if I tilt it to 'WEST', but if I tilt it to "IS", so he reacts properly and there remains little matter how I tilt the phone now.   Looks like a clear bug in the implementation of the RIM for me.

(3) if I combine your advice and

dc.setAcceptableScreenDirections(DirectionControl.DIRECTION_LANDSCAPE);

then things * almost * work, which means that if I run my application hold the phone in portrait mode, then it will be NOT to switch automatically in landscape mode (which IMHO is a bug), but if you want now tilt the phone to any orientation landscape, she reacts properly and stay there no matter how you tilt it the phone now.

Tags: BlackBerry Developers

Similar Questions

  • When I click on the 'Get' button in the app store for El Capitan, the beachball cursor rises and crashes the app store (not responding) in the force quit window...

    When I click on the 'Get' button in the app store for El Capitan, the beachball cursor rises and crashes the app store (not responding) in the force quit window...

    How can I fix it?

    Nevermind, I restarted the computer and it was fixed

  • I have an app called 'bin' it won't go away. Whenever I have 'close '. The app 'bin' should be 'force quit '.

    I have an app called 'bin' it won't go away. Whenever I have 'close '. The app 'bin' should be 'force quit '.

    I'm not aware of can't find something on an application called bin. Are you sure it's an app and not a .bin file? Search for .bin or bin and see where he is.

  • How to drag the apps? to force no click trackpad... I think they remove this features for elcapitan

    How to drag the apps? for a force not click trackpad...
    I think that they remove this features for elcapitan

    Select the application, and then hold down the trackpad (click), pressed with the left hand, while you use your right hand to drag the app.

    Note: This creates an alias to the place where you drag where you want to move , you also need the CMD key at the same time.

  • How to force the format landscape for mobile devices (phone & pad)?

    Hello, I am designing a new Web page in muse. It will be necessary for this layout, view the page in landscape format (mobile / ipad & iphone).  is there an opinion to force the format landscape for mobile devices? whereas even if the device is in portrait format, the site will be displayed in landscape format?  support told me that I will have to add the code. could you tell me the code and how do I insert this to my page? Thanks for your help

    This might help you:

    fixed vertical layout for mobile

  • Force the update of the app

    So I tend to become dazed Quill update. And often I'll light my TPT and I hope that it updates automatically (it's on) but it does on his own time. I'm sitting here with 7.0, wait until he realizes that a 7.1 is available. It happened with 6.0-7.0 > too. How can I force the tablet/Android fool to check / download updates?

    Once a day, I visit the market and search for updates. I suspect that there is a delay in a download of update on the market and the notification to users.

  • Force the persistent data that is not retained on App upgrade

    Hello

    I'm developing a new version of an existing application. The earlier version of the data stored in the persistent store of the device. When a user installs the new version of the application, they get a prompt saying something like "the persistent data is stored on the device. You want to keep these data? ».

    If the user answers Yes, the application will continue to use the old data which has been made persistent by the initial version of the application. This isn't what I need to happen.

    If the user answers no, the app will wipe the old dat and rebuild the store persistent with my current data. It is the course of action I want to request each time.

    Since there is no way to guarantee that each user will select 'NO' to this prompt, is it possible to configure the new version so that the data is not retained automatically?

    What other options are there for dealing with this situation?

    Thank you

    The f

    If the application can access the old data, why not just remove them when the application runs? In order to distinguish, again, you can design new data to contain a signature value that is not present in the old data. (For example, you can set your local record store to have record 1 always contain version store data, in a format that is not likely to be present in earlier formats.)

    An upgrade does not (usually) follow the same procedure with regard to the persistent data as a sequence of uninstall/install. However, there are occasional messages here on updates apparently lose persisted data that was supposed to be preserved. I did not understand everything exactly what are the causes which, but it has not considered the norm.

    P.S. If you use RecordStore instead of Persistable, custom classes are not relevant. The record store is deleted when all the MIDlets in the MIDlet suite, who created the store folder is uninstalled.

  • the share button don't work and need to leave the app after used

    the share button does not work and I need to force quit the app after used

    Any individual plugin or all of them?

  • I can't redownload the app Pinterest

    whenever I try to re-download it, it loads and then goes back to the cloud with the arrow! Help!

    Try to reset the App Store:

    Close the App Store completely from the window of the selector app by double clicking the Home button and slide up the App Store preview pane until it disappears from the display. Then sign out of the iTunes Store (in the settings).

    Then perform a forced reboot. Hold down the Home and Sleep/Wake buttons simultaneously for about 15-20 seconds, until the Apple logo appears.

    Then sign into the iTunes Store and try to download again.

    Also check the settings > general > Restrictions > and make sure that iTunes Store, Apps install, delete the Apps and In - App purchases are all under the section allow.

  • For 2 days were not able to access the App Store and regular a few adds on my iPad, but can be downloaded on my iPhone. I have reset the router, iPads, etc... No change. Help, please

    I can't access AppStore and some other operations ordinary adds on my iPad. Have reset and all routers. All updates current. I can do on iPhone. Is it me or Apple or what? Help, please

    Hello there jacquelinefrombburg,

    Welcome to the communities of Apple Support! It is a great place to get help with connection problems to the App Store and access other applications on your iPad. I know that there are some applications that I rely on every day, so I'll do my utmost to help find a solution.

    As point of departure, we will you force him to close all open applications on your iPad. Once you've done that, go ahead and reboot your iPad. Once it is up and running, test on the App Store to see if you are able to access. Here are some useful resources to guide you through the process described above:

    Force a nearby application on your iPhone, iPad or iPod touch

    Restart your iPhone, iPad or iPod touch

    If you still have questions, see the steps in this article. Even though the title says iTunes Store, the recommendations would still apply to the App Store.

    If you cannot connect to the iTunes Store

    As a step in isolation, it would be wise to check if you have problems with the App Store and other applications while using a Wi - Fi connection and cell phone. If the problem persists with the two types of connection, try resetting the network settings on your iPad. Please note that you erase all the stored passwords and Wi - Fi networks. To complete this step, go to settings > general > reset > reset network settings. After you restart your iPad, test the apps again.

    Take care!

  • My Instagram app will not open it keeps saying: "pending". I have tried to delete the app, off my phone and still nothing! Please help thanks

    My Instagram app will not open it keeps saying: "pending". I have tried to delete the app, off my phone and still nothing! Please help thanks

    You said that you tried to delete the app

    If you have not been able to

    Settings - general - storage - Storage - find the app - delete

    Do a forced reboot - after all open applications using the app Chooser - invoked by fast double pressing the home button and drag upwards on each app until it disappears from the screen.

    Meet the sleep/wake and home buttons down until you see the logo  - then release and allow normal start upward

    Then re download the app

  • My email on my iPad (version 8.4.1) application froze on a white page. I tried to power down and restart. I know I get emails that I can hear the ping and see numbers on the app. It has been frozen for a day and I have no way to display

    My email on my iPad 2 (IOS 8.4.1) froze last night on a blank page I was trying to send a few photos. I know I get emails that I can hear the ping and my email application shows that I have two new. I tried to put this off, then restart, but nothing changes. When I type my email application it goes to the blank page and after a few seconds goes back to my home page. I'm leaving on a trip to Europe at the moment I'm in a bit of panic. Any help will be greatly appreciated.

    You tried to close the Mail application via the taskbar of the iPad: force an app to close on your iPhone, iPad or iPod touch - Apple Support ?

  • Why the App Store search function does not work?

    Since the iOS most recent update (9.3.2), the app from the App Store does not work on my iPhone-iTunes app works perfectly, the App Store - space wasted on the screen and memory right now. I tried to disconnect, close the software, restart hard to my phone, but all I get when I try to search is a white screen. I can't even comment to apple in the app because it does not work. It was a time where this kind of thing never happened but the versions of software with major bugs is becoming more of a recurring theme lately. I'm really starting to wonder if Apple jumps right away even the most basic of pre-tests prior to publication just to get out a release. Frustrating to say the least.

    The search function on the App store on my phone work if something is wrong with your system. Try to reset the App Store in the following order:

    Close the App Store completely from the window of the selector app by double clicking the Home button and slide up the App Store preview pane until it disappears from the display. Then sign out of the iTunes Store (in the settings).

    Then perform a forced reboot. Hold down the Home and Sleep/Wake buttons simultaneously for about 15-20 seconds, until the Apple logo appears.

    Then reconnect to the iTunes Store.

  • I m using ipad mini I got the app store update message about garageband 2.1.1 and I hv software download full GarageBand via itunes, but cannot be installed software bcz itunes sync error

    I m using ipad mini I got the app store update message about garageband 2.1.1 and I hv software download full GarageBand via itunes, but cannot be installed software bcz itunes sync error

    Try to reset the App Store:

    Close the App Store completely from the window of the selector app by double clicking the Home button and slide up the App Store preview pane until it disappears from the display. Then sign out of the iTunes Store (in the settings).

    Then perform a forced reboot. Hold down the Home and Sleep/Wake buttons simultaneously for about 15-20 seconds, until the Apple logo appears.

    Then reconnect to the iTunes Store.

    Also try by going to settings > general > Restrictions > and make sure that iTunes Store, Apps install, delete the Apps and In - App purchases are all under the section allow. Try to install again.

  • A lot of apps is not found in the app store

    Since a week or two when I search for some applications in the app store they do not appear in the search results more. If I got them until I find them under "purchases" and can the re - install. Even a few apps I have installed will not be displayed in App Store, when I search for them.

    Among them are Soundcloud, Bandcamp and Spotify. Always when I type in the keyword search, I see, for example when I type Spo the first three terms of the proposed research are spotify, free spotify and spotify premium. Yet when I type one of them I get several apps but none are Spotify itself. ICloud same drive not will appear in the results of the search in the App Store, even not the Apple search word.

    This is exactly the same on my iPhone.

    Where did they go?

    Today, there is a problem with the App Store. It was well reported this problem. Please try again later.

    Since you mentioned the question for "a week or two" Alternatively, you can try to reset the App Store:

    Close the App Store completely from the window of the selector app by double clicking the Home button and slide up the App Store preview pane until it disappears from the display. You may be able to pick up the tab App Store covering scribbles to the left.

    Then sign out of the iTunes Store (in the settings).

    Then perform a forced reboot. Hold down the Home and Sleep/Wake buttons simultaneously for about 15-20 seconds, until the Apple logo appears.

    Then reconnect to the iTunes Store.

    Also try by going to settings > general > Restrictions > and make sure that iTunes Store, Apps install, delete the Apps and In - App purchases are all under the section allow. Try to install again.

Maybe you are looking for

  • When I hit the download, I do not get an option run, only to save it.

    I have Windows XP 32-bit. I want to download the correct version of Thunderbird. Step 2 says download instructions choose run when the download window appears, but I only a save option. Why? and what do I do?

  • Find in results page

    Hello! When to use search page in browsers other than Safari (i.e. mozilla), it shows the number of hits and the number of currently selected match. Is there a way to display the same in Safari? As currently selected: 12 of 27 matches. And similarly

  • Garage Band sharing iTunes

    I have recorded a track in Garage Band, shared to iTunes, but cannot sync with my iPhone. iTunes put it in a playlist called Garage Band. This playlist is not on my iPhone when plugged into my Mac. I tried to make a new playlist with the inside track

  • Pavilion dv7-6135dx: HP Pavilion dv7-6135dx - USB 3.0 port is?

    Hello. I'm trying to find out what my laptop usb ports are 3.0. I tried a USB SS symbol on the sides, but I don't see such a thing. On the right side, I see a USB symbol, but it doesn't have the SS beside him. I tried to find out if there was a diffe

  • PC will not open in Mode safe

    My moms ADVENT PC has stopped working and will not open in safe mode. If I try to open it in normal mode it gets stuck in a loop of trying to open and then automatically close down and then try to open it again. I have checked for viruses, it has bee