Questions tagged [android-configchanges]

185 questions
18
votes
1 answer

Orientation change in Honeycomb

I have an activity that shouldn't be recreated after an orientation change. I added the following to the activity declaration in the manifest: android:configChanges="orientation" On Android 2.3 this works perfectly. On HONEYCOMB_MR2 onCreate is…
hpique
  • 119,096
  • 131
  • 338
  • 476
13
votes
4 answers

Handling screen rotation in WebView

My web app works great in Chrome which handles configuration changes (such as screen rotation) excellent. Everything is perfectly preserved. When loading my web app into a WebView in my Android app then the web app loses state on screen orientation…
Fred
  • 12,086
  • 7
  • 60
  • 83
12
votes
2 answers

Getting "Fragment did not create a view" after addition of other Fragment without UI

I'm having a really weird problem. I have a common fragment that is added in almost every activity of my app. This fragment shows a small version of the player bar. So it listens some broadcasts to update the current music's name and has some…
Fernando Camargo
  • 3,085
  • 4
  • 30
  • 49
11
votes
1 answer

Why does onLayout and onSizeChanged get called twice on an orientation change?

I've noticed that onLayout and onSizeChanged get called twice in immediate succession after an orientation change, either from landscape->portrait or from portrait->landscape, when handling the configuration change from an Activity. Furthermore,…
MikeV
  • 1,220
  • 2
  • 13
  • 17
11
votes
4 answers

Does Fragment.getArguments() return passed arguments after configuration changes?

Sorry for my English Should I save and restore arguments (returned by getArguments()) during configuration changes via outState \ savedInstanceState ? Or getArguments() always returns passed arguments even after configuration changes ?
Leonid Semyonov
  • 473
  • 2
  • 6
  • 18
10
votes
5 answers

Android Activity instance state

What is the significance of: super.onCreate(null); instead of super.onCreate(savedInstanceState); With this change, I am able to avoid many problems that otherwise plague my Activitys each time a configuration change occurs (rotation, locale…
10
votes
5 answers

Android Layout land not working

I've been looking at issues in stackoverflow and I've tried everything I've seen but the layout-land not work. In my code I have and the method onConfigurationChanged @Override public void onConfigurationChanged(Configuration newConfig) { …
9
votes
3 answers

Viewpager on portrait and two panes on landscape

I'm trying to achieve a layout that shows a view pager when the device is shown on portrait and show two panes when device is on landscape. So I made two different layout files, one with only a ViewPager, the other with a LinearLayout and the other…
9
votes
1 answer

after configuration change fragment from backstack is now sharing the FrameLayout?

Problems with app: When orientation changes the app is experiencing these problems: Both FragmentA and FragmentC now occupy the FrameLayout container. What works: Everything works as I want it to...prior to rotating the screen. Activity…
9
votes
1 answer

Non-UI Fragment vs Singleton

I guess that the main purpose of the non-UI fragments is the storage of data that is retained over configuration changes, right? So, appart from being this storage specific for the Activity that owns this fragment, which is the benefit of its usage…
Iñigo
  • 12,723
  • 2
  • 31
  • 31
8
votes
0 answers

Is there a layout configuration qualifier for picture-in-picture (pip) mode layouts

I have implemented pip for my app. I note that in the Picture-in-picture support documentation it is suggested that android:configChanges= "screenSize|smallestScreenSize|screenLayout|orientation" is added to the manifest. This has the unwanted…
8
votes
3 answers

Android language changes after rotation

When my app is installed, on first run it asks user to choose language; But if user starts app on second time, language is set automatically (to previously selected one). Problem is that, on first run when user selects language, app still is in…
Giorgi Margiani
  • 215
  • 4
  • 12
8
votes
1 answer

findFragmentByTag null for Fragment A, if setRetain(true) on Fragment B

My problem involves an activity hosting three support fragments. One is a normal programmatic fragment (let's call it a home fragment). One is a portrait fragment added on top of the home fragment when the device is orientated, and one is…
8
votes
5 answers

Fragment recreated every time after orientation change, unable to restore state

Update: It turns out that the problem is from elsewhere. Thanks @Luksprog for pointing out what I overlooked. The project is created using Android Studio's navigation drawer pattern. The drawer is implemented in the NavigationDrawerFragment class.…
Edmund Tam
  • 868
  • 3
  • 7
  • 18
7
votes
0 answers

Can a configuration change occur after startActivityForResult was called?

Given the following situation (partially pseudo-code): User presses a button in Activity A which in turn executes this code: progressBar.setVisibility(VISIBLE) // by default is set as INVISIBLE in the layout …
1
2 3
12 13