Questions tagged [onconfigurationchanged]

154 questions
3
votes
1 answer

In android background image does not change when orientation does

I have a linear layout for my ActivityGroup as defined
3
votes
1 answer

Why isn't onConfigurationChanged being called?

I'm writing a code that changes the TextView's text when the orientation is changed I am using the onConfigurationChanged() listener for changing the text override fun onConfigurationChanged(newConfig: Configuration?) { …
rsanath
  • 1,154
  • 2
  • 15
  • 24
3
votes
1 answer

Override onConfigurationChanged while maintaining portrait mode

How do I detect landscape mode while maintaining my layouts in portrait mode? I have an activity which maintains the portrait mode irrespective of actual mobile orientation. I can do this by adding android:screenOrientation="portrait" to my…
3
votes
0 answers

scrollToPosition() "expand" RecyclerView

I have a RecyclerView with custom LayoutManager that handles the photo laying out so the result is different in portrait and landscape as you can see in the images below. Now everything is working fine except for when I handle…
3
votes
1 answer

ImageView Resizing On Orientation changes

I have a question regarding the process of resizing an ImageView Have on orientation changes. I have to place a bitmap on the top of an image view. (Basically a marker placed by the user when touching it). On orientation change, I store the…
3
votes
1 answer

Null object reference if configuration changes

I get null object reference if configuration changes for only LinearLayout objects. landscape mode I have to setVisiblity = View.GONE for all views except one view portrait mode I have to setVisibility = View.VISIBLE for all views: if (Activity…
3
votes
2 answers

On Rotation I get "Unable to destroy activity ... Can not perform this action after onSaveInstanceState"

Hi and thank you for any help. I am only at the very beginning of configuring my code to handle rotation: I have implemented onDestroy(), but not yet any onSaveInstanceState() or onRetainNonConfigurationInstance() because I am figuring out what will…
Lisa Anne
  • 4,482
  • 17
  • 83
  • 157
2
votes
1 answer

working of OnConfigurationChanged() in MonoDroid

I'm new to android development and I've been working on android through java(eclipse) till now but now I'm switching to Mono for Android which uses C#. In java on orientation changed, I've used following code snippet : @Override public void…
GAMA
  • 5,958
  • 14
  • 79
  • 126
2
votes
3 answers

onConfigurationChanged() is not being called on orientation change

I saw some related questions on SO, but I'm not able to resolve my issue. I've created separate layout for PORTRAIT and LANDSCAPE mode. I've modified the AndroidManifest.xml file for corresponding orientation change but onConfigurationChanged() is…
GAMA
  • 5,958
  • 14
  • 79
  • 126
2
votes
1 answer

How to respond for onConfigChanges in one of my tabs?

I have tab layout in portrait mode. Now I have to respond for onConfigChanges happened in one of my tabs. Following research on google I made this code: manifest.xml
2
votes
1 answer

Java Android Badge Drawable not working properly after configuration change

I have a Bottom Navigation view with a badge drawable that shows new chats. This badges are updated upon a listener to Firebase database, where I store the notification counter. When this value change, the badge is updated. Moreover if the counter…
E. Tocchi
  • 47
  • 1
  • 6
2
votes
5 answers

Saving the instance of Recycler view during orientation change

I have a RecyclerView which was build using an Arraylist. That Arraylist consists of User defined objects named ListItem. Each recyclerview has a card view. Each CardView holds each ListItem. I have removed one CardView from that RecyclerView. When…
2
votes
0 answers

Invalid context configuration

I have the util class to get the devices rotation (example below). It operates over application context. When I have phone in portrait mode, it returns PORTRAIT. However, when I rotate phone to landscape, then this method still returns PORTRAIT. The…
2
votes
2 answers

onConfigurationChanged() is not called for android:configChanges="density"

I added android:configChanges="density" for the activity in Manifest file. But I am not getting the onConfigurationChanged() callback
2
votes
1 answer

Resize ConstraintLayout on orientation change

I am playing video inside a layout in a ConstraintLayout and am overriding onConfigurationChanged rather than restarting the activity in order to prevent the video from stopping and starting on orientation change. I am trying to determine the best…
1 2
3
10 11