Android :: Force Portrait Screen
Aug 7, 2009I developed an application and when I flip the phone in landscape mode the application went in landscape too. How can I make the application stay in portrait mode no matter the phone orientation.

I developed an application and when I flip the phone in landscape mode the application went in landscape too. How can I make the application stay in portrait mode no matter the phone orientation.
Is there a way to pro grammatically force the screen to change between landscape and portrait mode? I want to allow the user to choose a menu item to rotate the screen, instead of relying on pulling out the keyboard. I am looking for something like activity.change Screen Orientation, but couldn't find such a thing in the API docs.
View 3 Replies View RelatedIs it possible to start the browser activity from my game but force it to be portrait regardless of orientation so that it matches the orientation of my game which is always in portrait regardless.
View 2 Replies View RelatedI want to force App Widget in portrait mode, as we force our activity in portrait mode by adding this attribute in Menifest file android:screenOrientation = "portrait". is there any way to force App Widget in portrait mode?
View 5 Replies View RelatedSo my Aria is less than 24 hours old and twice now when texting in landscape mode a Force Close pops up and I can only type in portrait mode. I am using HTC keyboard and have not loaded any other keyboard. is this happening to anyone else?
View 20 Replies View RelatedHow can I get the height of the device for portrait mode? I have to create a bitmap (which is zoomable) and I just want to get a rough idea what the tallest height should be. getResources().getDisplayMetrics().heightPixels; does the above return the height, in portrait mode only? I'm not binding my UI to this absolute value, it's just a rough fit.
View 1 Replies View RelatedDoes anybody know how to rotate whole system screen from landscape to portrait?The platform is not G1 or any other phones, it's just a normal ARM platform.Not only one application but whole system.
View 1 Replies View RelatedI specified an activity to be portrait-only in menifest file:
CODE:...................
But it won't work on Droid when its hard keyboard is popped out.
When hard keyboard is popped out, the device always renders the layout of the activity in landscape orientation first, then it switches it back to portrait orientation. How can I let the app only render the activity in portrait orientation?
How to rotate the screen to landscape (or portrait) by programmable way? I am trying to make it independent when user rotates the screen.
View 2 Replies View RelatedI want to change the screen orientation from portrait to Landscape and vice-versa when the user shakes his/her android mobile phone, can any one help how to achieve this, because I do not know what event is fired, at the time his/her shaking thier android mobile phone. For Instance When the users touch the button in UI, touch event is fired, similarly when the user shakes his android mobile phone, what is fired.
View 3 Replies View RelatedI've racked my brain for hours over this issue. I have created a main.xml and designed one for the res/layout-land (landscape) format and another one for portrait in res/layout. When I rotate the emulator (ctrl-F11), my app rotates properly to landscape using the correct main.xml, but a subsequent rotation back to portrait just keeps the landscape mail.xml. This was done in a 2.0 AVD.. Out of desperation I downloaded the new Sample Code for Multiple Resolutions and had to create a new 2.1 AVD, to my surprise rotation with this app works correctly as expected. So I then decided to try my app on the 2.1 AVD and it works perfectly. So, is this a Bug in a 2.0 AVD or is there something special I need to be doing for < 2.1 SDK versions?
View 4 Replies View RelatedHow do we change emulator screen orientation to landscape or portrait?
View 2 Replies View RelatedI worked in a tabactivity, I set the gravity for tabs as bottom. If I change the screen from portrait to landscape, I can't see the tabs. How can I do it?
View 1 Replies View RelatedI am using VideoView component for streaming video in Android , but I am not getting the full screen display.
Kindly provide the code to display full screen in portrait/landscape mode.
Is there anyway to find out if a device is portrait or landscape by default? In that I mean how you normally use the device.
Most phones have a portrait screen for normal usage but is there some flag for finding that out?
Is there a screen orientation lock feature? I haven't seen it mentioned. In fact a search only turned up mention of it as a hardware button on the iPad. This would be great for using it while lying down, reclining, in the car.
View 2 Replies View RelatedI noticed that the screen seems unresponsive at the very bottom of the screen near the hardware buttons. It's most noticeable when typing on keyboard and trying to hit spacebar; unless I hit the spacebar right on the middle or top, it doesn't register.i.e. hitting it toward the bottom 1/3 of the spacebar. It seems noticeable when hitting the phone, app drawer, or contact icons as well. Anyone else notice this? Found this on the Motorola forums about other having similar issue.
View 1 Replies View RelatedHow do I force the screen to stay active and not shut off while my app is running?
View 2 Replies View RelatedWe currently use Activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_x) to set (and 'freeze') the orientation of our app. Froyo now supports two landscape modes tho and we'd like to allow our users to orient the app to 'landscape right' ... ie, the orientation obtained by turning a device naturally oriented to Portrait 90 degrees clock wise.
View 3 Replies View RelatedMy app keeps force closing before it starts, eclipse returns no errors in my code and my xml is good.
package com.mhe.test.scan;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class main extends Activity {
/** Called when the activity is first created. */
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button myScanButton = (Button) findViewById(R.id.myScanButton); myScanButton.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "PRODUCT_MODE");
startActivityForResult(intent, 0);
} } );
} EditText totalbox = (EditText) findViewById(R.id.totalbox);
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == 0) { if (resultCode == RESULT_OK) {
String contents = intent.getStringExtra("SCAN_RESULT");
// Handle successful scan totalbox.setText(contents)
} else if (resultCode == RESULT_CANCELED) {
// Handle cancel totalbox.setText("@string/bummer");
} } } }
Essentially it is supposed to call zxing Barcode Scanner to scan a barcode on a button click and return the result into an EditText field.
I want my Activity to be always in portrait mode and I do NOT want the onDestroy() method to be called. There are some interesting articles about that at: http://www.androidguys.com/2008/11/24/rotational-forces-part-four/
The solution seems to be: In AndroidManifest.xml:
CODE:...............
I've tried it and it seems to work. Is there any other alternative or is it the correct solution?
I've got an app that I don't want to auto-rotate. Currently, I've got it setup so that it is always in portrait mode. However, I'd like to add a setting to my preferences where the user can choose either portrait or landscape mode. Is there a way to force screen rotation? Or, could I perhaps make two different layout XML files, one for portrait and one for landscape, and programmatically choose which to use?
View 9 Replies View RelatedI want to add home screen shortcuts to individual chat rooms, in my app.
Here's my code to do so:
CODE:.............
When I go to add the shortcut to my home screen, I get a Force Close, not on my own process, but on com.android.acore(!). I've run the debugger and verified that my code gets executed all the way to the call to finish().
If I do this instead for the EXTRA_SHORTCUT_ICON:
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, R.drawable.icon);
It works fine and places the shortcut, and the shortcut behaves correctly -- but of course the shortcut has the stock Android icon, not mine, since this isn't the proper way to specify the icon.
When I look at the source code of other apps that have done this, and at the one example of it in the official Android reference area, my code looks identical. My icon's a standard 48x48 png that I use for the app's main icon, without problems. I've verified this problem on an emulator running stock 1.6, haven't tested other versions.
I own a galaxy nexus and the performance of a few HD games are under my expectations, even with a bus overclocked kernel! (i've tried many, to no use )
Is there is a way to force selected apps to run at a lower screen resolution? say 540x960? i don't mind if it doesn't run in full screen, i just prefer a constant 60FPS over a few extra details!
I've thought there might be a shell script I could run, maybe get an app that can run shell scripts from an icon on the home screen--but I don't know what that script would need to be, since it couldn't be about killing a process because that process ID is probably going to be different every time, and I don't know if it would require root. Rooting my phone is not an option.
I'm going to assume though that there's probably no answer to this and that I'll just have to keep going in by hand to force stop the app via prefs/apps/name-of-app/force stop. I just wish these app makers would have an exit option. Twitter and Vine and Growlr are examples of these programs with this kind of behavior. Facebook as well, but that'll just reload itself when you force quit it because it's a special "system app". I mean, I'm not expecting them to exit when I just go to the home screen, that would be silly, but I'd like SOME sort of option to close them besides going through the hassle of force stopping them via the OS preferences.
I want there to be NO chance whatsoever that these programs are going to access data in some way once I'm done using them. I have no problem with whatever the programs want to do when I WANT them running, but when I'm done using them, I want to be able to quit them, and it has nothing to do with wanting to have more free memory.
Everytime i reboot my phone, I get bunch of problems with my phone. when I try to open the phone dialer I get a force close on com.google.process.acore. Sometimes it completely prevents me from using the phone.
Then on occasion the phone freaks out and shuts the screen off, but leaves the navigation lights on the bottom of the phone. At that point the phone is completely unusable for about 1-2minutes. Sometimes when it comes back on, it starts rerunning the media scanner.
I'm developing an application that render preview frames from the camera to a Surface View. I've noticed there's no way in the Camera API to set the orientation to portrait, so I'm forced to make my view landscape. Does anyone know how to tell the camera to deliver preview frames in portrait?
View 5 Replies View RelatedAm I the only one that prefers navigating in portrait as opposed to landscape. It seems that you get more view of the road ahead, rather then the sides. What am I missing, where / why would landscape be preferred?
View 3 Replies View RelatedI am trying to use Camera to take picture and to video recording but it always runs in portrait mode. Even if I tried to sreenOrientatiton="landscape" it solved screen appearance but when I take photo and capture video they are still saved rotated 90 degrees.
View 5 Replies View RelatedI know if you change a android phone from portrait to landscape sometimes the app relays its self out on the screen.. so how do I simulate rotating a phone with the AVD? On the Blackberry emulators there's a button in the menu to turn the phone, but I can't find it or any option on the Android ones?
View 1 Replies View Related