Android :: OnItemSelectedListener Called On Screen Rotation
Nov 20, 2010
When I change the orientation of my screen in Android, an OnItemSelectedListener from a Spinner is called. It's not just the emulator, it also happens on a physical phone. How can I stop this from occurring?
View 1 Replies
Mar 16, 2010
I'm using a ListView that is setup like this:
CODE:................
In my code I add an OnItemSelectedListener to the ListView like this:
CODE:................
my Activity implements the listener like that:
CODE:........
My hope was, that I would see this debug output the moment I click on something in the list. But the debug output is never shown in LogCat.
View 1 Replies
View Related
Mar 30, 2010
I've got an app where I don't want the screen to rotate when they rotate their device, I need to keep the app in portrait mode all the time. How do I do this?
View 2 Replies
View Related
Sep 20, 2010
How should I handle an active ProgressDialog when the screen is rotated? Perhaps I should cancel the dialog in onDestroy and restart it in response to a SavedInstanceState flag?
I'm getting an exception and the following message in logcat:
CODE:..............
View 7 Replies
View Related
Sep 10, 2010
Is there a standard pattern for handling a running AsyncTask with screen rotation? My AsyncTask runs for about 10 seconds. I could call AsyncTask.cancel in the Activity's onDestroy method and restart the task in onCreate but that would waste cycles, bandwidth, and user time. I'm guessing there is a better way.
View 1 Replies
View Related
Nov 22, 2010
In my Android app I have 2 layouts, one for portrait and one for landscape.
In both layouts I have a TextView that the user can change by clicking on, by default it reads 'ON'
If the user presses it then it changes to 'OFF' All well and good.
However if it's set to OFF and the screen is rotated the text view resets to ON. How can I stop this from happening?
View 1 Replies
View Related
Sep 16, 2010
Step #1: Make it a static inner class
Step #2: Manually associate your activity with the task in its constructor
Step #3: Return the task object from onRetainNonConfigurationInstance() of your activity
Step #4: In onCreate() of your activity, check getLastNonConfigurationInstance(), and if it is not null, associate your new activity instance with the task via a setter
Step #5: Use the activity within onPostExecute()
View 3 Replies
View Related
Aug 22, 2009
I have an activity which I have defined to keep in portrait position.
However I would still like to change things (slightly) when the screen is rotated, what is the best way of doing this? I notice onConfigurationChanged is still called, but this still reports portrait mode.
I want to keep the notification bar etc in the same position if possible.
View 4 Replies
View Related
Nov 1, 2009
Is there any way to make autorotation work in both ways: both clockwise and counter clockwise? It's a pain when reading a book that scrolls with volume keys (HTC Hero).
View 2 Replies
View Related
Aug 16, 2010
I'd like rotate the screen to put it upside down. Can I do that with android API? I was told by some friends that there are APIs to rotate the screen by 90 degree but I can't find a way to rotate the screen by 180 degree (upside down).
View 3 Replies
View Related
Apr 12, 2010
How to save my instance state or how to deal with my activity getting destroyed during screen rotation.
There seem to be a lot of possibilities but I haven't figured out which one works best for retrieving results of an AsyncTask.
I have some AsyncTasks that are simply started again and call the isFinishing() method of the activity and if the activity is finishing they wont update anything.
The problem is that I have one Task that does a request to a web service that can fail or succeed and restarting the task would result in a financial loss for the user.
How would you solve this? What are the advantages or disadvantages of the possible solutions?
View 3 Replies
View Related
Apr 18, 2010
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 Related
Mar 24, 2010
I have come across some very unexpected (and incredibly frustrating) functionality while trying to restore the state of a list of CheckBoxes after a screen rotation. I figured I first would try to give a textual explanation without the code, in case someone is able to determine a solution without all the gory details. If anyone needs more details I can post the code.
I have a scrolling list of complex Views that contain CheckBoxes. I have been unsuccessful in restoring the state of these check boxes after a screen rotation. I have implemented onSaveInstanceState and have successfully transfered the list of selected check boxes to the onCreate method. This is handled by passing a long[] of database ids to the Bundle.
In onCreate() I check the Bundle for the array of ids. If the array is there I use it to determine which check boxes to check when the list is being built. I have created a number of test methods and have confirmed that the check boxes are being set correctly, based on the id array. As a last check I am checking the states of all check boxes at the very end of onCreate(). Everything looks good... unless I rotate the screen.
When I rotate the screen, one of two things happens: 1) If any number of the check boxes are selected, except for the last one, all check boxes are off after a rotation. 2) If the last check box is checked before rotation, then all check boxes are checked after rotation.
Like I said, I check the state of the boxes at the very end of my onCreate(). The thing is, the state of the boxes at the end of onCreate is correct based on what I selected before the rotation. However, the state of the boxes on the screen does not reflect this.
In addition, I have implemented each check box's setOnCheckChangedListener() and I have confirmed that my check boxes' state's are being altered after my onCreate method returns.
Why would the state of my check boxes change after my onCreate method returns?
I have been trying to degub this for a couple days now. After I found that my check boxes were apparently changing somewhere outside my own code I figured it was time to ask around.
View 4 Replies
View Related
Mar 2, 2013
How to make Android's screen rotation faster (like iPhone)?
View 6 Replies
View Related
Mar 9, 2010
I am working on a home screen widget. I hope this widget can support auto rotation. For example, if the phone is in portrait mode, I want this home screen widget to be 2 cell * 2 cell on the home screen; if the phone is in landscape mode, I want this home screen widget changes be 3 cell * 1 cell on the home screen.
View 2 Replies
View Related
Jul 29, 2010
My 2.1 rom only went into landscape mode when I turned the phone counter-clockwise. I have found that since updating to 2.2, the screen will go into landscape if I go either direction! I really liked the old one way landscape, and I wonder if this was intended, or just the result of an unfished leak...
View 11 Replies
View Related
Aug 24, 2010
I have an android application that I want to always be running in landscape mode.
I have the following code implemented to keep the app in landscape mode all the time:
inside my activity in the Application Manifest
android:screenOrientation="landscape"
This seems to launch and keep the application in landscape view for the whole duration of the application. Perfect!
However, if I have the app running on my HTC Aria (Android 2.1) and the phone locks, if I unlock the phone, I see the application for probably half a second and it's in portrait orientation and then quickly switches back to landscape mode. It is quite frustrating because all of my views are jumbled around and it looks unprofessional as you can imagine. This happens in both the emulator and on my real phone.
Does anyone know how to stop the application from temporarily rotating when the phone is unlocked?
I have tried overriding onConfigurationChanged() but with no success.
I have also tried putting setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); into the onResume() but the app still shows as the incorrect orientation for a split second when the phone is unlocked.
View 3 Replies
View Related
Sep 13, 2009
1. When does OnItemSelectedListener get called?My expectation was that when an element of a ListView was clicked/ touched that the OnItemSelectedListener would be called. My OnItemSelectedListener is not called when a list element is clicked/ touched. (It is called if the list has focus and I move through the list with the arrow keys in the emulator) Is that the way it works? This ListView has an adapter that supplies TextViews for drawing the list elements.
2. With a ListView set up this way who handles display of selected list items? Does the ListView do it or should the adapter configure the views it supplies to make them look "selected?"
View 2 Replies
View Related
Mar 3, 2010
I'm creating a spinner and I've added an OnItemSelectedListener to it. However I've noticed that it fires on create. Now I was wondering if there was a way to ignore/discard it. I know I could use a boolean value, but that's a bit "dirty".
View 1 Replies
View Related
Oct 12, 2009
I have a layout that looks like this (some attributes removed for brevity)
<RelativeLayout>
<ImageButton
android:id="@+id/button"
android:nextFocusRight="@+id/gridview"/>
<GridView
android:id="@+id/gridview" />
</RelativeLayout>
When I navigate using the DPAD from the button to the gridview, the OnItemSelectedListener is not fired. However a new layout pass is perform. Why is this ? Is this an android bug & my bug?
View 1 Replies
View Related
Aug 30, 2010
Does anyone know of a ROM that is Sense based and also includes a Home Screen Rotation ability?I know that LP can do this, but I value the Sense widgets more than resorting to LP.unless every single Sense widget could be replaced for under $15 total.
View 6 Replies
View Related
Feb 26, 2010
Running BB1.1, but it doesn't allow the screen to rotate automatically, even though that option is turned on in the settings. I noticed Ultimate 3.7 does allow this, what other ROMs allow it? It's a minor feature, but one I like to have....
View 5 Replies
View Related
Aug 23, 2010
Is horrendous with the update. It goes landscape all of the time in unwanted situations. Is this just me?
View 1 Replies
View Related
Dec 21, 2013
I have been trying to keep the context menu when doing a long press / Click to stay on screen when the screen is rotated.Searching around the net, the main answers found are not the best such as add configChanges into the android manifest or use the onRetainNonConfigurationInstance which is depreciated .
Currently I am handling my dialog boxes when on screen and a rotation occurs via savedInstanceState by having my own method to show them again by using a variable to be saved into the bundle and then retrieved.
However the context menu is slightly harder to do as it is registered against the listview I have and this links it together so it knows which row has been selected
I do also have a onitemlongclick method which works along side the contextmenu so I should be able to get the row information from there but it is then how to call it all back afterwards
View 7 Replies
View Related
Jul 16, 2010
I was working on implementing a more advanced list view then the standard one they teach you in basic tutorials, and I did find a great tutorial explaining how to create your own Adapter and such not. http://www.softwarepassion.com/android-series-custom-listview-items-a...
I do have a working version of the tutorial and I am currently in the process of changing the list to suit my needs, but there are a few issues I am stumped on. If your run the tutorial code it creates a little progress dialog saying that it is retrieving data. In my application it is going to be fetching data from the internet and storing it in an ArrayList of custom objects. However if I where to rotate the screen the progress dialog pops up again, I have no clue on how to set it up so that when it rotates that it doesn't recreate everything and re-fetch the data and process it again.
View 4 Replies
View Related
Jul 7, 2010
My Desire; which i have had problem free for 3 months; has just developed a problem with the screen rotation. Initially it wouldn't rotate so i checked that it was set to automatically rotate in the screen and display menu which it was .
I then tried to recalibrate the screen which kind of worked in that it now allows the screen to rotate to landscape if held sideways, but when i put it the right way up, the screen stays landscape.
I have Swype which i thought might be interfering so i removed the program and rebooted but still nothing.
View 1 Replies
View Related
Jan 5, 2010
I feel foolish as all get-out, but I have managed to put the screen on my Eris into an animated rotation mode. I.e. instead of snapping from horizontal to vertical, it rocks from side to side for a annoying period of time. I can't find the setting under 'display'
View 5 Replies
View Related
Jan 15, 2010
Is there a way to make the map rotate in naviagation so that you are always pointing up insead of North always being at the top of your screen?
View 4 Replies
View Related
Nov 24, 2009
I've just come across a topic on android-hilfe.de which shows an early build of galaxy rotating the screen all four ways:
YouTube - Samsung i7500 Android Phone Review - auto sense rotation and picture browser @ OCWORKBENCH
View 1 Replies
View Related
Aug 16, 2010
Since the 2.2 update my screen auto rotation is horrible. When I want it upright, it goes sideways. WHen I hold the phone sideways, it flips the other way. Apps that I open seem to always start out sideways even when the phone is upright. I turn it around, nothing happens. If it does rotate back, it is so delayed you think it is not working. It never seems to be the direction I want it, getting very frustrating and annoying to keep flipping the damn phone around all the time to try to get it right. I sure hope the new FRG22 update, if it ever comes, can fix this problem. So far, 2.2, besides flash, has been a big disappointment for me.
View 27 Replies
View Related