Android :: Set Screen Orientation Of A Tab

Mar 18, 2009

I would a Tab (in a TabHost) to have a Landscape orientation while the activity with the TabHost is in Portrait orientation, is that possible (if so how)? I tried setting the orientation of the Activity displayed in the tab in the Manifest but it didn't work.

Android :: Set Screen Orientation of a Tab


Android :: How To Check Screen Orientation While Call On Screen?

Dec 16, 2009

Is it possible to check the screen orientation (I mean whether the screen in landscape or portrait mode) while the outgoing call is going on.If it possible please suggest me how to achieve that.

View 2 Replies View Related

Motorola Milestone :: Manually Rotate Screen Or Keep / Fix Current Screen Orientation

May 29, 2010

is it possible to manually rotate the screen or fix the current screen orientation (with a key/button)? because it really annoys me having taken portrait pictures that cannot be viewed (with the media gallery application) in a portrait fashion on the milestone. this is because it always rotates the portrait picture back to landscape when rotating the milestone from landscape to portrait. right now there is no way of properly viewing portrait pictures on the milestone other than tilting your head (holding the milestone landscape and tilting your head along).this cannot be the way it was intended to be, right? or do I have to get a different viewing software which allows you to choose screen orientation? is there such an app?

View 1 Replies View Related

Android App And Screen Orientation

Jan 19, 2012

I was wondering if there was any java code that will allow you to make sure each window in your app stays in portrait despite the user flipping the phone to landscape. I already tried inserting android:screenOrientation="portrait" into both my android manifest and into every single XML file I had but unfortunately only some stayed in portrait and others still flipped to landscape.

View 3 Replies View Related

Android :: Screen Orientation Change

Oct 8, 2009

I notice when using the emulator that when the screen is flipped, I get a following logcat message:

INFO/WindowManager(589): onOrientationChanged, rotation changed to 1

How can I catch this in the code? I want to know whenever the orientation changes. I assume I have to set a listener, but I can't find an example anywhere.

View 6 Replies View Related

Android :: Keep Screen On And Change Orientation

Feb 11, 2009

I am making an Android app which is currently coming along nicely - I've hit upon a couple of stumbling blocks.

1) How do I stop the screen from going dim/off and the phone locking while the application is running?

2) Can I force the phone to enter landscape mode on running my application?

View 2 Replies View Related

Android :: Handling Screen Orientation

Jul 6, 2010

My project is working fine when i hold my HTC device vertical.But the moment i rotate my screen 90degrees , it throws a force close error.Starts all over again, runs fine until i again change the orientation.How do i handle it ?

View 1 Replies View Related

Android :: How To Get Current Screen Orientation

Jul 2, 2010

I simply want to do code...

The problem is - getRequestedOrientation always returns -1. Any suggestions?

View 2 Replies View Related

Android :: Live Wallpaper Screen Orientation

Sep 23, 2010

I have a series of live wallpapers out and one major sticking point I have with a certain set is that when devices switch to Landscape, the wallpaper, which in most cases is an image designed to fit the screen in portrait mode, appears off center. What is the conventional way to detect the shift from portrait to landscape?

View 2 Replies View Related

Android :: Threads And Screen Orientation Change

Aug 30, 2009

In the following sequence of events:

1. Start a new thread (as a result of a button click - or similar).

2. User changes the screen orientation (causing the Activity that started the thread to be destroyed).

3. Thread finishes, and wants to do some dialog (or any UI) work. However, doing a showDialog, dismissDialog, ... will crash, as the thread it still referring to the old Activity.

This can be solved by updating the data in the thread to refer to the new Activity upon a screen orientation change.

However, couldn't the Android framework just forward any requests from a destroyed activity, to the newly created Activity, saving us developers of handling it ourselves?

View 24 Replies View Related

Android :: On Screen Orientation Changes Activity Restarted

Aug 16, 2010

I know on screen orientation changes activity restarted, but suppose i don't want to restart the activity then what should I do? I had tried it by adding in manifest.xml. android:configChanges="keyboardHidden|orientation"

and override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); }

But still activity restarted each time when I change screen orientation.

View 17 Replies View Related

Android :: Fix Orientation Of App On Screen / Control Accelerometer?

Mar 2, 2010

Please tell me how i can stop the change in orientation of application when device rotate. How i can control the accelerometer.

View 5 Replies View Related

Android :: OutOfMemoryError When Changing Screen Orientation

May 8, 2009

I get an OutOfMemoryError every time i change the screen orientation and I am having a hard time finding the mistake...

The Activitie's view consists of an ImageView, two Buttons and a Spinner. I don't have static variables and can't imagine where i could leak a context.

Most of the times, the exception is thrown at setContentView (R.layout.upload); sometimes it goes fine until imgUpload.setImageURI(imageURI);

The images i am displaying are form the G1's camera, so about 500kb and 2048x1536pixels

Here is some code:

CODE:..................

View 3 Replies View Related

Android :: Prevent An App From Going To Home Screen When Orientation Is Changed?

Nov 18, 2010

I snap a photo, and it gets placed onto an ImageView. When the user sees the page where the Image View is, and I turn the phone sideways where the orientation is horizontal, the app immediately returns to the app's main screen.

View 1 Replies View Related

Android :: Way To Force Screen Orientation To Landscape Right As Of Froyo?

Sep 24, 2010

We 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 Related

Android :: Force Screen Orientation And Destroy Call

Aug 27, 2009

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?

View 7 Replies View Related

Android :: Catch Screen Orientation Change In OnPause()?

Apr 23, 2010

Specifically, I need a way of _not_ performing the onPause functionality I've implemented when it occurs because of a change in screen orientation.

View 9 Replies View Related

Android :: Display Image From URL - Sizing And Screen Orientation?

Aug 30, 2010

I am trying to display an image from a URL, which may be larger than the screen dimensions. I have it kind of working, but I would like it to scale to fit the screen, and I also have problems when the screen orientation changes. The image is tiny, and I would like it to scale its width to the screen as well. (In both cases, I would like the image to fill the screen width with scrollbars (if necessary for height).

Here is my ImageView:

CODE:..............

Here is the java code which loads the image: (some error handling code removed for simplicity)

CODE:.........

I have tried different settings for android:scaleType. I'm sorry if this question has been asked before. I've gone through a number of tutorials on the subject, but they don't seem to work for me. Not sure if it has anything to do with the way the image is loaded. (from the web instead of a local resource)

Another issue is that sometimes the image doesn't even load. There are no runtime errors, I just get nothing in the ImageView.

View 1 Replies View Related

Android : Assigning Keyboard Based On Screen Orientation

Nov 5, 2010

Finally I've been waiting for something like this. Swype - portrait; stock - landscape.Assign Keyboards Based on Orientation - Keyboard Manager for Android | xda-developers

View 2 Replies View Related

Android : Does Screen Orientation Change / Effect Performance?

Jan 21, 2009

From reading Romain Guy's blog post, I understand keep static reference to a Drawable can create huge memory leaks. So what is the recommended solution if I don't want to reload my big Drawable image every time screen orientation changes and effect on performance? Currently my app takes >3 seconds to complete each orientation change.

View 8 Replies View Related

Android :: Change Screen Orientation From Portrait To Landscape?

Nov 1, 2010

I 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 Related

Game For Android - Changing Screen Depending On Orientation

Jan 18, 2012

I am working on a game for android at the moment, and was wondering how i would change the screen depending on orientation.

So if the user turned the phone horizontally then the app would be viewed horizontally if you know what i mean

Also how would i make a timer, so if a button were pressed, how would i say stop for 2 seconds and then go to link?

View 3 Replies View Related

Android :: Orientation Change - Dialog Above Activity With Fixed Orientation

May 14, 2009

I have created an activity for my game which handles all orientation changes by itself and has a fixed "portrait" layout. Actually it uses the accelerometer and is rendered using 2D canvas methods. If the level has been completed I show up a highscore dialog in which the user can enter his name. The dialog is floating above the underlying level screen which gets blurred out nicely. This generally works.

Problem is that the dialog does not get rotated if the orientation of the phone changes. So even if the keyboard is exposed the dialog is shown in portrait mode instead of landscape. I have tried to use an activity with dialog theme instead but the behavior didn't change. After several tries it seems that I have found the reason for this: Once there's an activity with fixed orientation in the activity stack then all subsequent activities keep this orientation, too. They will not react on orientation changes anymore (e.g. if the keyboard gets exposed).

After upgrading to 1.5 SDK the described behavior changed a little bit. Now at subactivities indead react on orientation changes like expected. However, the need to have an opaque background! That means that neither dialogs nor activities with dialog theme will work. Those will stick with the orientation of the underlaying activity. So my workaround is to first start a sub-activity with an opaque black background. This activity then shows my highscore dialog on top. It looks quite okay but I wonder if there's a better solution? Is it possible to show a dialog above a fixed portrait or landscape activity which automatically adapts to orientation changes?

View 3 Replies View Related

What To Do When Screen Orientation Changes

Jan 12, 2014

I have some code in place that checks for if the screen has been re orientated which works fine.But its what I do after that that seems to be a pain.if I put an if statment in that stops any methods that would normally be trigged on the oncreate method my screen is empty on rotation.if I try to just reinflate the view, that doesn't work because I havent saved the data that it displays to singleton.

It basically seems like I have to save my individual vars to a singleton then if the screen reorientates use them... But then that seems really crude and crappy stuff like if you scroll down the viewlist the position is refreshed to the top when you reorienate..What Im doing basically just doesnt seem right?

View 1 Replies View Related

Android :: How To Detect Orientation Change In Home Screen Widget?

Mar 15, 2010

I am writing a home screen widget and want to update (modify) the home screen widget when the device orientation changes from portrait to landscape or the other way. How can I make it? Currently, I tried to register to CONFIGURATION_CHANGED action like the code below ...

View 3 Replies View Related

Android :: Screen Orientation Landscape Back To Portrait Not Working

Mar 20, 2010

I'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 Related

Android :: Screen Orientation / Shake Cellphone Crashes Application

Jan 15, 2010

I am having search application, which loads data retreived from the webservice.While application on create it shows progress dialog once its done with loading data it dismiss the progress dialog.problem is while loading if i change the orientation of the phone it works fine it try to load activity again, but if i start shaking the cellphone while it is loading data application get crashed, any solution?

View 1 Replies View Related

Android :: ViewFlipper Switching Views On Screen Orientation Change

Jan 24, 2010

I have a 3 nested ViewFlippers which seem to be working ok except that when I change the screen orientation the view flip back to the first one of my views, giving the user the impression it went back a few steps.I am a bit stumped as to what to do and was hoping someone had some experience with this.

View 3 Replies View Related

Android :: Save And Restore A ButtonText When Screen Orientation Is Switched

Nov 7, 2010

As usual in android, each time the screen is flipped to portrait/landscape mode an Activity runs through life-cycle from onSaveInstanceState to onDestroy and then is recreated.In my Activity there's a ButtonText which can be changed by the user. It's reseted to the initial state, but I have to save the last state somehow. How can I achieve that, will I have to override onSaveInstanceState? Can someone show an example?

View 1 Replies View Related

Android :: Handling Screen Orientation Change During Activity Start

Mar 12, 2010

I'm trying to find a way to properly handle setting up an activity where its orientation is determined from data in the intent that launched it. This is for a game where the user can choose levels, some of which are int portrait orientation and some are landscape orientation. The problem I'm facing is that setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) doesn't take effect until the activity is fully loaded. This is a problem for me because I do some loading and image processing during startup, which I'd like to only have to do once.

Currently, if the user chose a landscape level:

the activity starts onCreate(), defaulting to portrait discovers from analysing its launching Intent that it should be in landscape orientation continues regardless all the way to onResume(), loading information and performing other setup tasks at this point setRequestedOrientation kicks in so the application runs through onPause() to onDestroy() it then again starts up from onCreate() and runs to onResume() repeating the setup from earlier

Is there a way to avoid that and have it not perform the loading twice? For example, ideally, the activity would know before even onCreate was called whether it should be landscape or portrait depending on some property of the launching intent, but unless I've missed something that isn't possible. I've managed to hack together a way to avoid repeating the loading by checking a boolean before the time-consuming loading steps, but that doesn't seem like the right way of doing it. I imagine I could override onSaveInstanceState, but that would require a lot of additional coding. Is there a simple way to do this?

Solution:

As per Daniel's answer, this was actually quite easy to fix. I just needed to make a few small changes. In my 'menu' Activity, where the player would choose which level to play, I just had to add an if/else check to choose which class would be started by my Intent. This was done with a simple int representing portrait or landscape, determined when the player selected a level. I then created a second class extending my 'GameLogic' class; this is the class which contained most of the code for the game itself, rather than the menus, instructions, etc.

public class GameLandscape extends GameLogic{}

Literally that simple and completely empty. That way it inherited all the code from my previous activity where I had already coded it to handle things differently depending on the orientation. Lastly I just had to add a line to the manifest stating that GameLandscape would always run in landscape, and GameLogic would always run in portrait.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved