Questions tagged [onconfigurationchanged]
154 questions
0
votes
2 answers
Android - Lock phone to portrait but allow tablet to be both landscape and portrait
I am trying to write an app where I want the phone to be locked to portrait, but allow the tablet version to have both landscape and portrait.
I have created something that almost works based on all the following questions...
How do I lock screen…

Russ Wheeler
- 2,590
- 5
- 30
- 57
0
votes
1 answer
0
votes
2 answers
Change layout if orientation change, error with buttons
I used onConfigurationChanged method to know when the orientation change. But, when I call other layout the buttons not working.
here is my code:
IntroPage.java
package com.example.mysqltest;
import android.app.Activity;
import…

user3386169
- 3
- 4
0
votes
1 answer
Fragments Adaptative UI (typical two-fragments news reader) - First fragment missing when in dual pane mode
I'm trying to adapt my app to the Adaptative UI Flows example, but I'm missing something and I don't know what it is. As you'll see below, the NewsListFragment loads its layout depending on whether the device is in portrait or landscape mode, and…

Jorge Antonio Díaz-Benito
- 1,036
- 12
- 32
0
votes
2 answers
initLoader - how to handle configuration change?
I am trying to use commonsware's LoaderEx in my project. So I tested LoaderExDemo project. It works fine. But when I change the device from portrait mode to landscape mode the loader variable is going to be null.
In onCreate method we initialize…

bCliks
- 2,918
- 7
- 29
- 52
0
votes
1 answer
Receive ConfigurationChange but *do not* 'rotate' application
Imagine my app displays a house drawn in portrait mode:
|------|
|******|
| _ |
| / \ |
| | | |
| | | |
|______|
|......|
--------
The stars above represent some menu of mine.
The dots below represent android's software back, apps and home…

George
- 3,727
- 9
- 31
- 47
0
votes
0 answers
Android: start new activity on orientation changed, without recreating old activity
I need to start new activity when user sets the device in landscape orientation without changing orientation of the old activity.
So, I have 2 activities:
(1) Old activity in portrait only
(2) New activity in landscape only
The app scenario looks…

Marcin Szulc
- 141
- 2
- 13
0
votes
0 answers
Android orientation related issue
I have my test application for Phone in portrait mode and for tab in landscape mode.
I am calling setRequestedOrientation method to set the orientation of the application to SCREEN_ORIENTATION_SENSOR_LANDSCAPE or SCREEN_ORIENTATION_SENSOR_PORTRAIT…

User7723337
- 11,857
- 27
- 101
- 182
0
votes
1 answer
Need to hit this nail on the head... retaining fragment and view onConfigurationChange
We have a web service which serves up an XML file via a HTTP Post.
I am downloading and parsing this xml file into an object to populate some views inside a couple of fragments held in a FragmentPagerAdapter. I get this XML file via an AsyncTask and…

Karl
- 3,394
- 2
- 22
- 31
0
votes
2 answers
Do something right before Screen Rotation?
i want to do_something() whenever the device rotates from Portrait to Landscape.
i have added in my manifest. So onConfigurationChanged() will be called whenever i rotate my device. And it will not…

midnite
- 5,157
- 7
- 38
- 52
0
votes
4 answers
Android landscape right to landscape left event
I would like to now if the is any possible way to trigger an event when the layout is being redrawn because of the event of switching directly from landscape right orientation to landscape left orientation.
I tried the OrientationEventListener. The…

Stefan Alexandru
- 563
- 1
- 5
- 18
0
votes
0 answers
GridAdapter shows view0 instead of view4 on screen orientation changed
I have a GridView with a BaseAdapter that shows 6 buttons like this:
Portrait:
B11 B12
B21 B22
B31 B32
Landscape:
B11 B12 B21
B22 B31 B32
Everything works great, until I switch from landscape back to portrait. It then shows:
Portrait:
B11…

Radu
- 2,076
- 2
- 20
- 40
0
votes
3 answers
onConfigurationChanged Null pointer exception when phone restarted?
Well the problem is, i have livewallpaper that has inside main class a onConfigurationChanged,
the code is
public void onConfigurationChanged (Configuration newConfig){
if(MODE == 0) {
if(newConfig.orientation ==…

Allen
- 65
- 9
0
votes
2 answers
onConfigurationChanged not getting called on rotation
my problem is onConfigurationChanged is not getting called.
Code is as follows:
public void onConfigurationChanged(Configuration newConfig) {
Log.i("onconfig", "#### CALLED!");
// TODO Auto-generated method stub
…

user1763170
- 119
- 1
- 2
- 13
0
votes
1 answer
TabHost empty on rotation Android by using onConfigurationChanged
I have a problem with onConfigurationChanged and TabHost.
Because my Activity restart on rotation, I found this very helpful post:
Activity restart on rotation Android
I sort gui elements out to the function InitialGui()
public void onCreate(Bundle…

JaMaBing
- 1,051
- 14
- 32