Questions tagged [android-configchanges]
185 questions
1
vote
1 answer
How to maintain SoftKeyboard AND Refresh Layouts in Android
When the device rotates, I have different layouts based on portrait/landscape. So I can't put this line in manifest:
android:configChanges="orientation|screenSize|keyboardHidden"
However, if the user is in a EditText field and the keyboard is out,…

TheLettuceMaster
- 15,594
- 48
- 153
- 259
1
vote
1 answer
Refreshing view attribute (specified in resources) after configuration change
I have a dimen specified in values/ and values-w600dp/ because I would like an icon to be wider on very wide screens.
values/
32dp
values-w600dp/
48dp
layout/

Mark
- 7,446
- 5
- 55
- 75
1
vote
2 answers
Older devices and AndroidManifest configChanges "screenSize"
Quoting the documentation:
Caution: Beginning with Android 3.2 (API level 13), the "screen size"
also changes when the device switches between portrait and landscape
orientation. Thus, if you want to prevent runtime restarts due to
…

Thomas Calc
- 2,994
- 3
- 30
- 56
1
vote
1 answer
Android - Forcing orientation in smartphones only
My app has 3 screens, and all of them must be portrait-only in smartphones and both orientation for tablets.
Unitl now I was using the following code in OnCreate:
if (!getResources().getBoolean(R.bool.isTablet)) {
…

Saito Mea
- 455
- 4
- 11
1
vote
1 answer
updating locale needs to override OnConfigurationChange which is not directing to layout-land xml which is again needed
I have been using Locale for app language which on orientation change needs to be reconfigured.
But in my code I have to direct my activity to layout-land for which i need to destroy and recreate my activity to reset the Xmls.
Can anyone tell me how…

sheetal
- 3,014
- 2
- 31
- 45
1
vote
3 answers
how to restore video play state in android webview
In my activity, I am loading you-tube video content into my web view like this:
webview.loadData("

Ganesh K
- 2,623
- 9
- 51
- 78
1
vote
1 answer
Handling orientation changes with dynamic spinners
I have searched the web and keep trying for 5 hours but I couldn't find a way to solve the problem. I want to keep the state of my spinners after orientation changes.
I have 2 spinners which are created dynamically. They get their items by http…

Srht
- 473
- 3
- 7
- 17
1
vote
1 answer
When does 'touchscreen' and 'navigation' configuration changes trigger?
Reading through Android's documentation for android:configChanges, I find:
"touchscreen" The touchscreen has changed. (This should never normally happen.)
"navigation" The navigation type (trackball/dpad) has changed. (This should never…

Jay Sidri
- 6,271
- 3
- 43
- 62
0
votes
1 answer
configChanges not recognized by TabHost?
I have a pretty big problem with my TabHost. Although I have declared all of my Activities (Including my TabHost Activity) to ignore orientation and keyboardHidden, if I flip my Phone (Android 4.0) It still recreates the activity.
Here is a…

user754730
- 1,341
- 5
- 31
- 62
0
votes
2 answers
Lost reference to variable after configuration change
I have an acitivty which looks for user location (MyLocation class), then with the geopoint or without it it runs an AsyncTask to connect to server and get list of cities from my server. When the list is ready it saves them in ArrayList cities. Once…

Michał Klimczak
- 12,674
- 8
- 66
- 99
0
votes
0 answers
Android configuration changes and calling requestLayout - why doesn't it work?
In Android activities, we can manually handle a configuration change (e.g., orientation, screen size) by setting android:config and implementing onConfigurationChanged - typically, we would update the UI based on the new configuration.
I am trying…

Adrian Pang
- 1,125
- 6
- 12
0
votes
0 answers
Android EditText loses/restore focus on ConfigChange
In my layout, I have an EditText that clears itself when it loses focus (so the hint text is shown) and a recycler view that gets focus initially. Typically, when the user launch the activity, they can scroll through the recycler view, or tab into…

Adrian Pang
- 1,125
- 6
- 12
0
votes
3 answers
Android save certain values on rotation
I have an activity that runs asynctasks among other things, I don't want everything to be reset when the layout changes.
I put this in the activity's manifest element android:configChanges="orientation" but unfortunately the activity doesn't even…

CQM
- 42,592
- 75
- 224
- 366
0
votes
1 answer
problem with onConfigurationChanged in TabActivity
I have TabActivity and also three others activities in tabs. In Manifest file I have line:
android:configChanges="orientation|keyboardHidden|keyboard"
in tag of the TabActivity and also three others activities. I have also overrided in…

woyaru
- 5,544
- 13
- 54
- 92
0
votes
1 answer
Android Library read from caller's manifest file
New to android development and asking for best practices around the following.
I am building a library for multiple apps. One of the parameters I have for the library calls is the appname. Can I pick this up from a parent config file to clean up…

kjsteuer
- 617
- 1
- 6
- 14