Questions tagged [android-configchanges]

185 questions
0
votes
0 answers

Android RecyclerView and addOnScrollListener

This is My file where I want to fetch position on screen rotation. and my saveInstance state But I am Facing a logical error while the screen is rotated I am getting a position for first but addOnScrollListener making it 0 and automatically…
0
votes
1 answer

Does using one attribute of configChanges calls onConfigurationChanged() anyway?

If I use this code in my Manifest file: //<-SEE THIS
sandalone
  • 41,141
  • 63
  • 222
  • 338
0
votes
0 answers

UI is not changing as expected while changing orientation in android

Here I am using different UX designs for portrait and landscape mode for a particlular activity. Created the folders layout-sw600dp and layout-sw600dp-land ,layout-sw720dp and layout-sw720dp-land for portrait and landscape mode. But the…
0
votes
2 answers

How to use different design for landscape and portrait mode without recalling the API calls on that Activity?

I have some API calls on my activity and different UI design for portrait and landscape mode. I have added the below code in the manifest to avoid the activity recreation on mode change. But with the below code, will not support a different UI. So…
0
votes
0 answers

onDestroy called for Landscape activity A when Portrait activity B is opened from A

I have an Activity A for which orientation (Portrait or Landscape) is set based on some condition. I have another activity B which is Portrait. Now when Activity A is in portrait mode and If I open Activity B then the activity A is not destroyed.…
0
votes
1 answer

How do I not reset my fragments when configuration changes happen?

So I have this activity that creates 4 fragments for me, which are a bottom navigation bar. when I change to dark mode or light mode, the fragments reset and take me back to the "main fragment" which is basically home in the bottom navigation…
0
votes
2 answers

How do I save the current URL state in Android WebView?

In the browser that comes with Android, when you rotate the phone, the WebView is not reloaded. I was wondering how to do this. I can save the current URL of the Webview and pass it to the next version of myself, but how do I do that with the whole…
Isaac Waller
  • 32,709
  • 29
  • 96
  • 107
0
votes
1 answer

Android - Restore dynamically added view state on orientation change

Im currently working with custom views which will be added to a layout dynamically. I understand how view states are safed and restored. According to the documentation, only views with an id will be persisted by the system. So the suggested solution…
0
votes
1 answer

In RecyclerView, keep element expanded / selected in config changes

I'm developing an Android app. I have a RecyclerView, and I can expand my items (several at the same time). The problem ocurrs when the orientation changes. I have a ViewModel, so the data is loaded again. But the items expanded are lost. What is…
0
votes
1 answer

onConfigurationChanged is not working for API17

I would like to trigger something if the table were tilt from portrait to landscape or vice versa. However the onConfigurationChanged is never get triggered. I have read few question raised few year back from stack-overflow fans, but none is…
0
votes
2 answers

How do I keep a menu item group open when rotating android device

I've handled screen rotation config changes in the android manifest, which works for dialog themed activities, however for these menu groups, which open after selecting a menu item (in onOptionsItemSelected) still close when I rotate the screen. Can…
Phil
  • 35,852
  • 23
  • 123
  • 164
0
votes
1 answer

Gradle - Android - add version code number as versionNameSuffix to debug buildTypes

I want to add the version code as a suffix of versionNameSuffix. Currently, I have: debug { versionNameSuffix ".debug" } How can I have something like: debug { versionNameSuffix ".debug.versionCode" } My version…
0
votes
0 answers

UI updates across config changes: The weird point

I am an experienced Android developer and it is a shame that I am still ineffectively fighting against fundamental issues like persisting UI changes across configuration changes. I know, this is an all too well known problem and there exists a lot…
Manish Kumar Sharma
  • 12,982
  • 9
  • 58
  • 105
0
votes
1 answer

How to avoid restart activity in my cordova app when device is put into a car cradle (managing runtme changes)

there are a lot of questions around this, however I was not able to solve. My app shouldnt restart when the device is put into a specific car cradle. I just want to ignore it I tried changing manifest + What do I need to code if I…
0
votes
2 answers

Why screenSize changes when the user switches between landscape and portrait?

According to Android guide "screenSize" changes when user rotates the device, why isn't "orientation" value enough to indicate that? Link to android guide of activity tag
Toka A. Amin
  • 156
  • 1
  • 2
  • 16