Questions tagged [screen-rotation]

Screen Orientations change in a sensor based (touch) phones, when you rotate. In other phones, developers want to rotate the content, on an event when users click on a button or an option that specifies this function, or as a default option when e.g. when you have written code for landscape orientation and running on device, which has portrait resolution.

Screen Orientations change in a sensor based (touch) phones, when you rotate. In other phones, developers want to rotate the content, on an event when users click on a button or an option that specifies this function, or as a default option when e.g. when you have written code for landscape orientation and running on device, which has portrait resolution.

496 questions
341
votes
51 answers

RecyclerView: Inconsistency detected. Invalid item position

Our QA has detected a bug: when rotating the Android device (Droid Turbo), the following RecyclerView-related crash happened: java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 2(offset:2).state:3 To me, it…
88
votes
13 answers

How to handle an AsyncTask during Screen Rotation?

I read a lot on 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…
Janusz
  • 187,060
  • 113
  • 301
  • 369
53
votes
4 answers

How to save custom ArrayList on Android screen rotate?

I have an ArrayList with custom objects that I would like to be able to save and restore on a screen rotate. I know that this can be done with onSaveInstanceState and onRestoreInstanceState if I were to make the ArrayList its own class, which…
Kalina
  • 5,504
  • 16
  • 64
  • 101
48
votes
6 answers

Retain the Fragment object while rotating

I have developed an app in Honeycomb and I am using fragments. This is my app I have an Activity (Say A1) and in that there is a fragment Initially this fragment hold the object one fragment object say (F1) Then depending on the user actions it…
Jithin
  • 1,745
  • 4
  • 18
  • 25
38
votes
12 answers

UIImagePickerController camera view rotating strangely on iOS 8 (pictures)

I have a very simple application: - All orientations are permitted with only a button on a screen - The button show a UIImagePickerController (to take a photo) - Build with Xcode 5 and SDK 7 On iOS 8, the camera of the UIImagePickerController is…
36
votes
9 answers

iOS 6 rotations: supportedInterfaceOrientations doesn´t work?

I´m having this issue with iOS 6 SDK: I´m having some views that should be allowed to rotate (e.g. a videoview), and some that don´t. Now I understand I have to check all orientations in the app´s Info.plist and then sort out in each ViewController,…
stk
  • 6,311
  • 11
  • 42
  • 58
34
votes
5 answers

PhoneGap - Forcing Landscape orientation

I started looking into PhoneGap yesterday and created a simple "marble" rolling around while tilting the phone. I am currently developing on Android but I want the orientation to stay as landscaping instead of moving when the phone gets spun around.…
Phil Jackson
  • 10,238
  • 23
  • 96
  • 130
33
votes
9 answers

How to maintain presenting view controller's orientation when dismissing modal view controller?

I have this app I am working on and I need ALL my view controllers but one to be in portrait. The single one view controller that is special I need it to be able to rotate to whatever orientation the phone is in. To do that I present it modally (not…
Mihai Fratu
  • 7,579
  • 2
  • 37
  • 63
32
votes
8 answers

Allow video on landscape with only-portrait app

I have a UIWebView included in a UIViewController which is a descendant of UINavigationController. It looks like this: The app is portrait only. When I play the video I want the user to be able to rotate the device and see the video in landscape…
entropid
  • 6,130
  • 5
  • 32
  • 45
20
votes
3 answers

Stop only iPhone screen rotating in Universal Xcode 6 project

With the introduction of Xcode 6, Apple removed the ability to easily have multiple storyboards for iPad and iPhone in Universal apps. Due to this, you cannot differentiate between iPad and iPhone on the rotation panel/settings. How can i stop the…
InfinityLoop
  • 429
  • 3
  • 15
19
votes
4 answers

Detect rotation changes in iOS

I am making an iOS app that needs to do a little interface rearrangement upon rotation. I am trying to detect this by implementing - (void)orientationChanged:(NSNotification *)note, but this gives me notifications for when the device is face up or…
Undo
  • 25,519
  • 37
  • 106
  • 129
18
votes
1 answer

Using onConfigurationChanged in a fragment

I have this code in a fragment public class TestOne extends Fragment { View view = null; @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); LayoutInflater…
16
votes
0 answers

How to map Frame coordinates to Overlay in vision

I'm feeling that this Question is already solved many times, but I cannot figure it out. I was basically following this little Tutorial about mobile vision and completed it. After that I tried to detect Objects myself starting with a ColorBlob and…
Rafael T
  • 15,401
  • 15
  • 83
  • 144
15
votes
5 answers

How do I detect screen rotation

I have an activity that is showing a compass, and I need to know the orientation of the screen to properly rotate the needle. I need to distinguish between 90° and 270° degree rotation to properly handle this. When I rotate the screen (on my Nexus S…
Michael
  • 1,416
  • 1
  • 9
  • 21
15
votes
1 answer

How to prevent conflict animation with device rotation in android?

I have a two button objects in activity this object has some move animation with ObjectAnimator these animations work perfect but when the animation is run in background i want to rotate device some times portrait mode coordinate in ObjectAnimator…
Khalil
  • 238
  • 2
  • 15
1
2 3
33 34