Questions tagged [android-configchanges]

185 questions
7
votes
3 answers

"Error: String types not allowed (at 'configChanges' with value 'keyboard|keyboardHidden| orien"... in AndroidManifest.xml

Before all, i am a rookie in Android, and i am using API 10 (Gingerbread). I am developing a simple game with libgdx. But i just install everything for start to work and... in the AndroidManifest.xml this line:…
yukatta
  • 505
  • 2
  • 7
  • 16
7
votes
1 answer

How to setup night mode drawables to work as expected

I what to change background as night mode changes. I have /values and /values-night folder, that contain "colors.xml" with different values. ` #ebebeb #c7c7c7
Solata
  • 1,444
  • 3
  • 28
  • 42
6
votes
4 answers

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, RecyclerView must start from the beginning of the…
6
votes
1 answer

onClickListener not working (properly) after ConfigurationChange in fragments

Introduction Huh, this is a tough one. At least, I think so... To clear things up: I did not find any answers to my question after searching the internet (using Google). Everything I found was about people setting up the onClickListener's for…
creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402
6
votes
0 answers

When an activity is destroyed due to a configuration change, are its Loaders destroyed as well?

From the developer guide on Loaders, They automatically reconnect to the last loader's cursor when being recreated after a configuration change. Thus, they don't need to re-query their data. From this blog post on Loaders, when an Activity is…
6
votes
2 answers

Screen flickers when running on Android 4.2. (Activity gets restarted continuously)

Some users reported that my app screen sometimes flickers when running on Android 4.2 (only!) I tried on my device, and after putting logs, the activity is restarted and restarted again, about 3 times a second. So what I did is to trace the method…
5
votes
2 answers

Android Layout Direction is not updating on run-time language change

I'm working on a application which supports two different languages - English Arabic The user can switch to any language at any time & based on the selection I'm changing the app language. Mentioned below are the code snippet - public static…
Amrut
  • 2,655
  • 3
  • 24
  • 44
5
votes
1 answer

Avoiding Application Restart when Hardware Keyboard Opens

I am currently working on a multi-threaded game application for the Android platform... so far so good... I just got over a bug in my application which caused it to restart on orientation change (fixed by designating a specific orientation depending…
5
votes
1 answer

Get the current language of the application not the device Android

So I'am using a button to switch language from english to french ! My problem is that i need to know the language of my current Application only not the language of my device . I'am using these line of code in order to know the current language…
Ahlem Jarrar
  • 1,129
  • 1
  • 12
  • 33
5
votes
1 answer

AsyncTask & runtime config change: what approaches, with concise code samples, does the Android team endorse?

Since AsyncTask was introduced in Cupcake (API 3, Android 1.5) in 2009, it has been consistently promoted by the Android team as simple: "Painless threading" "an easy way to execute some work in a background thread and publish the results back on…
5
votes
3 answers

Android get system locale different approaches

So, I found out that there are two approaches to get system's locale in Android: Locale.getDefault() And getResources().getConfiguration().locale Basically question is - can output differ for these two? Or are they always the same and I can use…
Heisenberg
  • 3,153
  • 3
  • 27
  • 55
5
votes
1 answer

Multiple Permissions Dialogs in Android using Sign in with Google after orientation change

I've been wrestling with this one for a while -- and I've searched extensively for answers on here but haven't found any (so apologies if I've missed a resolution). I'm implementing a "Sign in with Google" button/logic and all works fine EXCEPT when…
5
votes
1 answer

Android how to efficiently implement data caching and configuration change events in fragments?

I'm confused in finding a better way to implement: 1) data caching, as I am fetching data from rest APIs by executing AsyncTask in every fragment say 3-4 times, what I want is to reload the data from cache instead of calling the AsyncTask again. 2)…
4
votes
3 answers

Dialog must not be dismiss when screen orientation change

I've created a custom tab activity which has two different drawables for portrait and landscape orientation. The icons for portrait screen is under drawable-hdpi while the images for landscape is under drawable-land-hdpi. As of now, I put config…
iamtheexp01
  • 3,446
  • 9
  • 35
  • 35
4
votes
1 answer

Handling orientation changes conditionally

I added android:configChanges="orientation" and I override onConfigurationChanged(). What I'd like to do is allow the landscape orientation change only if the device has a tablet-sized display resolution setting (shorter side greater than 480px -…
Rich
  • 36,270
  • 31
  • 115
  • 154
1
2
3
12 13