Questions tagged [onconfigurationchanged]

154 questions
2
votes
1 answer

Fixed orientation Activity lifecycle on a slide out keypad phone

I have an Activity with a fixed orientation, android:screenOrientation="portrait" in my manifest. I noticed that when pressing Cntl-F11 on the emulator and when a user slides out the keyboard on a device the Activity is destroyed and onCreate is…
user432209
  • 20,007
  • 10
  • 56
  • 75
2
votes
0 answers

When i rotate to landscape and then rotate back to portrait and choose next song it doesn't update the songinfo

Ok so I have an activity where I display a song that's playing, and I created another layout for landscape mode, I have an imageview that displays the album art from that song and a title in the actionbar, all display information of the playing…
2
votes
1 answer

Android - Handle Screen Orientation

I'm currently working on an Android application that have different behaviors according to the screen orientation. I'm using getWindowManager().getDefaultDisplay().getRotation() to get the screen orientation in the onCreate() method and manage from…
Ours
  • 392
  • 6
  • 21
2
votes
1 answer

Android OnConfigurationChanged not being called when I plug or unplug usb keyboard

this is my onConfigurationChanged : @Override public void onConfigurationChanged(Configuration newConfig) { //this will change the language, if needed. super.onConfigurationChanged(newConfig); Log.i("onConfigurationChanged", "keyboard: "…
rosu alin
  • 5,674
  • 11
  • 69
  • 150
2
votes
0 answers

Display Size Change event in Nougat

I was just checking with nougat settings on my Nexus 5x and found a setting as Display Size. I added: android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboardHidden|density" for my activity in Manifest file so that I…
Nayan
  • 367
  • 4
  • 18
2
votes
3 answers

Activity OnConfigurationChange is not being called

My Activity onConfigurationChanged is not called at all. I have updated my SDK API to Marshmallow ; In my code overwrite "onConfigurationChanged": @Override public void onConfigurationChanged(Configuration newConfig) { …
A.AL
  • 135
  • 3
  • 12
2
votes
1 answer

Android MediaRecorder. Continue recording after screen rotation

I have simple app that records audio using MediaRecorder class. When screen orientation changes audio recording stops. How can I continue recording after screen rotation? Is android:configChanges="orientation" the only way?
2
votes
1 answer

Android: Custom Animation lost after Orientation change

I've done a ton of research and literally tried everything that I can think of. Basically, I have 3 activities Activity 1 -> Activity 2 -> Activity 3 I have set up a slide_left and slide_right animation files. Basically when the user clicks to go to…
2
votes
1 answer

onConfigurationChanged not getting called even with manifest config changes - Why?

I know the question is awful, done thousands of times ; But seriously, I've been stuck for 4 hours trying to solve this. I came into every link from 2009 until today and all of them give the same solution which (**** knows why) is not applying into…
2
votes
1 answer

What is the relationship between Activity.onConfigurationChanged() and Application.onConfigurationChanged()?

I notice that there are two Android methods with the same names and parameters: Android.app.Activity.onConfigurationChanged(Configuration) Android.app.Application.onConfigurationChanged(Configuration) All of the documentation I can find (such as…
2
votes
2 answers

Multiple calls to FragmentTransaction.replace() - only one works after orientation change

I am using the following code to populate my UI with 2 fragments, the containers are FrameLayout's defined in XML. This first time this code is called i.e. when the app starts, it works fine, and both my fragments are displayed as expected. However…
2
votes
2 answers

Change Android layout with Fragments

I am developing an Android Activity which has two Fragments. The Activity has two possible layouts, one in Portait, and another one in Landscape. I have created the Fragments working well, but I'm having troubles when I change the orientation of the…
2
votes
0 answers

Exception appears when fragment layout is changed while screen rotation in TabHost

colleagues! I've got an exception which I don't know how to avoid. I created TabHost with ViewPager in SherlockFragmentActivity. TabHost contains fragments. Activity: @Override protected void onCreate(Bundle savedInstanceState) { …
2
votes
2 answers

Prevent Chrome from reloading page on re-orientation?

This is my first app, it is a web app, it simply loads a webView to a url where stuff happens. It works fine in android browser(gingerbread), but in Chrome(ICS, JB) it was going back to the initial webView url when the device is rotated. In…
2
votes
3 answers

android camera flash light turns off on changing orientation

Possible Duplicate: Flash light is getting switch off while changing the orientation I am building an android app. On configuration change the flash light goes off. Then I need to again click the ON button to make it on. how can it remain…
Aditya Arora
  • 45
  • 1
  • 8