190 questions
2
votes
0
answers
118
views
How to avoid activity recreation due to change in CONFIG_ASSETS_PATHS?
After reboot the LauncherActivity is created. Then following a config change the activity is destroyed and recreated. I could in the log that ActivityTaskManager: Config changes=80000000 is printed. ...
0
votes
1
answer
103
views
Which Android configuration change do I need to ignore to prevent activity destruction/creation when system language changes?
My Vulkan-based game is based on NativeActivity and needs to avoid ALL activity destroy/recreate configuration changes because of the massive amount of load time it takes to do that. I currently have ...
0
votes
1
answer
140
views
Trigger configuration changes manually in java Android
I have a scenario in my app where the expected behavior occurs during a device configuration change, such as an orientation change. This means that whenever the user changes the device's orientation, ...
0
votes
0
answers
99
views
Why does changing the system language cause my Android NativeActivity to crash?
My game is based on NativeActivity and crashes for some reason when the user changes the phone language while the game is running. Why is this happening and how can I prevent it?
My app consists of ...
1
vote
0
answers
61
views
Textview fontsize SP vs android resource dir... Is there a resource dir for font size config?
In my app we are using mostly SP in order to help visually impaired people.
However, sometimes font is just too big or too small and android components don't work very well, cutting some text or ...
0
votes
0
answers
90
views
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 ...
0
votes
0
answers
98
views
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 ...
1
vote
2
answers
1k
views
How to support Spanish and French Language in android?
I want to change the application content from English to Spanish/ French as per the selection. Do we have any build-in libraries for the same. I am new to this multilanguage part, so please help me ...
2
votes
1
answer
767
views
Android How Lifecycle-Aware Components Detect Configuration Change inside ViewModel
My Fragment:
class FirstFragment : Fragment() {
private lateinit var binding: FragmentFirstBinding
private lateinit var viewModelFactory: FirstViewModelFactory
private lateinit var ...
7
votes
0
answers
116
views
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 ...
0
votes
1
answer
93
views
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 ...
3
votes
3
answers
2k
views
How to Handle Transition of Night Mode?
We implemented night mode to our application. it works like a charm except for its transition. We are using the Base Application class to implement it. The problem is no matter what we tried we couldn'...
0
votes
1
answer
153
views
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 ...
2
votes
0
answers
1k
views
createConfigurationContext is not working
I want to change my app language , this is a code I've for supporting different api versions
val config: Configuration = context.getResources().getConfiguration()
val locale = Locale(...
1
vote
0
answers
113
views
Manually updating layout view objects in ARCore Android application
I'm currently running into an issue in an ARCore Android app (this is without sceneform). I have an activity that has a fragment that holds the ARCore session object, as well as the OpenGL ES context ...
1
vote
1
answer
1k
views
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 {
...
2
votes
1
answer
930
views
Using android:configChanges="orientation|screenSize"/> And It is Messing Up My Landscape Layout on Orientation change
When I put in
activity android:name=".MainActivity"
android:configChanges="orientation|screenSize"
and do it for each one of my activities, the layout when I flip the orientation in the emulator ...
2
votes
0
answers
520
views
Unable to disable app rotation in Multi-Window (split-screen) mode, Android
First of all, here are things I've done so far: (1) I handle screen rotation, orientation changes and Multi-Window related config changes inside my application. (2) I forbid all kinds of configChanges:...
0
votes
1
answer
225
views
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 ...
1
vote
2
answers
353
views
Android loadout/layout-land onConfigurationChanged
I have a DialogFragment in my Android app, and I need to set android:configChanges="orientation|screenSize, I want to load different layout for my DialogFragment in portrait or landscape, but now ...
6
votes
4
answers
1k
views
Determine if fragment restart is due to screen rotation or Viewpager swipe?
I have an Activity with ViewPager. the ViewPager have a lot of pages, Just like a book. Each fragment has RecyclerViews with a lot of content. The following is my use case
1 - When I swipe page, ...
0
votes
1
answer
267
views
Android XML configChanges tag has no effect
The
android:configChanges="screenSize|orientation|keyboardHidden">
tag has no effect. My activity always is destroyed when the device is rotated. I do not know why this is. I have added every ...
1
vote
0
answers
506
views
“Configchanges.Locale” not working to reflect the change in language selected from device settings [duplicate]
I have added "ConfigurationChanges = ConfigChanges.Locale" in MainActivity. Upon changing language from settings, the app restarts when selected from background but language change is not reflected. ...
1
vote
0
answers
167
views
Is onActivityResult() method called after a config change?
Activity A starts for result activity B. The user rotate the smartphone. The user press the back button. Activity B is finished. Activity A is re-created. After the onCreate() method, is the ...
0
votes
1
answer
681
views
When do we need to override callback onConfigurationChanged()?
If we do not want to restart the activity during config changes, we can set flag android:configChanges;
If we need to restart the activity (i.e., to update resources), we should not set the flag.
In ...