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
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
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
Aug 19, 2010
I understand how to force a specific orientation per activity in the android manifest. I would like to know if it is possible to allow the keyboard to change orientation even though the activity(the layout really) must remain unchanged.
View 1 Replies
View Related
Jun 15, 2009
I found if change screen orientation continouously when a call is ongoing, that is, portrait -> landscape -> portrait- >landscape.
View 3 Replies
View Related
Aug 6, 2010
Here is a thread example in Android SDK sample (BluetoothChat).code...
In order to destroy this thread, first to close the socket. But this thread is still running at the blocked call mmInStream.read() even mSocket.close is successfully run.
Question: How to properly destroy a thread stuck in blocked call?
View 3 Replies
View Related
Jun 3, 2010
I'm new to android and i was wondering if there's anyway to force landscape mode at all times. Another way of saying it, i never want to see portrait orientation on my device. Is there any settings or apps that will force landscape mode at all times (unless an app requires portrait)?
View 1 Replies
View Related
Oct 4, 2010
My application has a portrait mode, and a landscape mode. I want the user to be able to force the landscape orientation by clicking on a button. How can I do this programatically?
View 1 Replies
View Related
Jun 20, 2010
I've been experimenting with orientation change and have seen a strange behavior (at least to my opinion) when I change the orientation from landscape to portrait. To make the explanation more concrete let's consider the following super-simple code:
CODE:...................
I put breakpoints at lines 9 and 15 and start the emulator in debug mode. The application starts and hits the breakpoint at line 9; so far so good. Then I press Ctrl+F11 to change the orientation from portrait to landscape. The debugger stops first at line 15 and then line 9. Everyhting normal so far. I hit once again Ctrl+F11 to change the orientation from landscape to portrait and some mumbo-jumbo starts happening. Here is the sequence of function calls I observe: 1.onDestroy() 2.onCreate() 3.onDestroy() 4.onCreate()
I really fail to understand why the platform needs to make the calls "2.onCreate()" and "3.onDestroy()". Can anyone explain why this is happening? At least I don't find it convenient because I need to implement more logic, because the extra calls "2.onCreate()" and "3.onDestroy()" cause side effects in my case. However, it would be interesting to know why these extra calls are taking place.
View 5 Replies
View Related
Aug 3, 2009
I have a requirement where I have to read/parse some data from the server(using HTTPConnection) and then display it on to the screen. To avoid ANR issue I used AsyncTask to perform the above. Now in order to avoid application crash in case the activity gets destroyed(either by OS or if orientation changes or say on any incoming call-->where user stays on the phone for long and for some reason OS destroys/recreates the activity). Currently, I hols the reference of AsyncTask in my activity and then provide a callback(the activity itself) to AsyncTask so that I can pos back message to activity(like closing progress dialog box).In order to avoid memory leaks on onPause I nullify this activity reference in AsyncTask.Before onPause I save the AsyncTask instance using onSaveInstanceState method but I have to use putSerializable for that. I have read on the forums that serialization method is slow, so my question is should I use parcelable approach(and whether the converting AsyncTask to parcelable will be same as creating any other object parcelable). or both these approaches are totally wrong i.e...............
View 10 Replies
View Related
Oct 29, 2010
I want to change layout without calling the onCreate method. i also define android:configChanges="orientation|keyboardHidden" in my activity and it is not calling the onCreate method but the layout not adjust appropriately on landscape mode.
my current layout look like as follows.
after change orientation as landscape it look like as follows:
but on landscape i want the following result.
is there any auto adjacent property?
how can i do it?
View 2 Replies
View Related
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
May 20, 2010
My application contains 2 activities A and B. B is opened with startActivity(intent) in A, when B is closed with finish(), I found the method finalize() of B is not called.
My question is: How to force Activity to call finalize() when it is closed with finish()?
View 5 Replies
View Related
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.
View 7 Replies
View Related
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
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
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
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
Jul 2, 2010
I simply want to do code...
The problem is - getRequestedOrientation always returns -1. Any suggestions?
View 2 Replies
View Related
Sep 23, 2010
Been trying to call Preferences.java class using:
Intent settingsActivity = new Intent(getBaseContext(), Preferences.class);
startActivity(settingsActivity);
I have this in my Manifest.xml (outside the main app class activity). code...
Any ideas why it's force closing even though I have the Activity defined in the Manifest.xml?
View 1 Replies
View Related
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
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
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
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
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
Nov 19, 2010
I own an xperia mini pro and I can replicate the issue always now. When I get an incoming call while the screen is off, if you slide out the keyboard (without opening the screen lock), immediately I get a Force close error for com.android.phone. I have Lookout Mobile security along with SayMyName installed. I have tried removing both, but the problem does not seem to go off. I am using Zeam as my home screen. On FC, SayMyName continues to call out the caller (or number if its not recognized), but the phone application crashes and on closing the FC pop up, the GSM mobile connection reinitiates (I am not in 3G).
Its just like when you switch on the phone after a shutdown. I have even tried changing home screen (ADW same problem), but seems like this issue persists. The problem is I keep my phone in a pouch attached to my belt and when I get a call, many times while bringing out the phone, the sliding of the keyboard happens and I get an FC. Then, there is no way to make out who had called and its very irritating (the call log does not register the call due to the FC).
View 5 Replies
View Related
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
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
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
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