Questions tagged [android-configchanges]
185 questions
2
votes
1 answer
How to handle configuration change in android annotation.(Rotation of screen)
I am using Android annotation.There is a progress dialog but when i am rotating the screen (land to port) . The progress dialog dismiss and showing these error's in log cat.
Activity com.example.progressdialog.AnnotationProgressDialogActivity_ has…

Monty
- 3,205
- 8
- 36
- 61
2
votes
1 answer
What is the common practice to handle relation between Activity and Thread
I have the following situation
I spawn a long running user thread (Thread) from an Activity.
I press soft back button. So, the Activity was destroyed.
I launch the same Activity again. Note, the previous launched Thread is still running.
In order…

Cheok Yan Cheng
- 47,586
- 132
- 466
- 875
2
votes
1 answer
Preventing onDraw() function from restarting during config changes
I have an activity which basically sleeps for a time and initialize another activity. During this sleep time I make some animated drawings on screen.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
…

Srht
- 473
- 3
- 7
- 17
1
vote
0 answers
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 miscalculating the appropriate width and height of the…

htafoya
- 18,261
- 11
- 80
- 104
1
vote
2 answers
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 with this.

Malhotra
- 221
- 3
- 13
1
vote
0 answers
Enable App to modify Android system's Dark/Night Mode Setting
I'm trying to develop an app that would be able to change the System dark mode setting (device wide). It would enable us to quickly access that "dark mode" setting and easely toggle it.
As I'm getting frustrated, I'm now basicaly throwing everything…

Pierre Rose
- 651
- 3
- 11
1
vote
1 answer
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 viewModel: FirstViewModel
override fun…

Sam Chen
- 7,597
- 2
- 40
- 73
1
vote
1 answer
Change App Language in devices with API 22 String don't change
I want to change String when change app locale
there is Profile Fragment
@Override
public void onClick(View v) {
Intent intent = null;
switch (v.getId()) {
case R.id.changeLanguageButton:
if…

Mohamed Sobhy
- 11
- 2
1
vote
1 answer
How to determine device screen size category (small, normal, large,) using code?
Currently using the below code but getting the same as normal for all Categories. Even if I go to setting and set as small also. Please help me.
if ((getResources().getConfiguration().screenLayout &Configuration.SCREENLAYOUT_SIZE_MASK) ==…

Mr_vmh
- 171
- 1
- 9
1
vote
2 answers
Android: are there cases when an Activity is re-created even when "android:configChanges=" set to everything?
First, a short description of the problem's background:
I've run into troubles with handling background workers lifecycles in line with Activity lifecycle. First problem is that a new instance of activity is created whenever the configuration…

JBM
- 2,930
- 2
- 24
- 28
1
vote
0 answers
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 tied to the surfaceView, and an external C++…

Soud Kyl
- 55
- 5
1
vote
0 answers
Android, Changing app language not working properly on oneplus and huawei
I am changing the app loacale like this,
Language language = getPreferenceAppLanguage();
if (language == null) {
return;
}
Locale locale = createLocale(language);
Locale.setDefault(locale);
…

jaydeep_gedia
- 484
- 2
- 4
- 13
1
vote
1 answer
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 doesn't match how I made it in design mode.…

Alexandra
- 125
- 1
- 11
1
vote
2 answers
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 Android will not automatically do this for me, I…

newszer
- 440
- 1
- 4
- 23
1
vote
1 answer
How to solve when getLayout() method in edittext becomes null, when configuration changes in android
I am trying to get a single line from a multi line Edittext in its addTextChangeListener, using the textwatcher interface.
I wanted to update another EditText with the only first line of this EditText. Its all working fine, except when the device…

Asgar Ahmed
- 47
- 2
- 5