Screen flip doesn't trigger an orientation change and Activity destruction/recreation

by Rob » Mon, 30 Aug 2010 06:24:49 GMT


Sponsored Links
 I'm testing an app on a Droid. It's a kind of card matching game.  I'd
like to keep the cards physically located in the same place on the
screen regardless of a screen rotation.  For example,  I can put my
thumb on a card, rotate the phone any way I please and the card stays
fixed under my thumb.  However, the orientation of the content of the
card will change to match the current phone rotation.  I handle this
by transforming the card grid in onCreate.  This works fine for 90
degree rotations, but if I do a fast 180 degree flip from one
landscape mode to another the screen simply flips and the Activity is
NOT destroyed and recreated.  This seems contrary to the
documentation:

 http://developer.android.com/reference/android/R.attr.html #configChanges

"  public static final int  configChanges
Since: API Level 1

Specify one or more configuration changes that the activity will
handle itself. If not specified, the activity will be restarted if any
of these configuration changes happen in the system. Otherwise, the
activity will remain running and its Activity.onConfigurationChanged
method called with the new configuration. "

I am NOT specifying any configChanges in my AndroidManifest.xml file,
so it seems that the activity SHOULD be destroyed and recreated.  Why
isn't it?  Is there some way I specify that it should be destroy/
recreated?  Thanks.

--



Screen flip doesn't trigger an orientation change and Activity destruction/recreation

by TreKing » Tue, 31 Aug 2010 05:29:20 GMT


 



Just guessing, but landscape is landscape, regardless if it's 180 degrees,
so the system may not consider it to be a configuration change.



Sounds like a case where you should handle the orientation changes and / or
read the accelerometer values yourself.

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

--


Sponsored Links


Other Threads

1. Dynamic Buttons Onclick

Hi.

I have some dynamic buttons that are being generated inside a for loop.

for (int i = 0; i < 5 ; i++) {



aUIXButton.setClickable(true);

aUIXButton.setText("X");



@Override

public void onClick(View arg0) {

aUIXButton.setText("Y");

}});

}


This is not working. It says
"Cannot refer to a non-final variable aUIXButton inside an inner class
defined in a different method"

& wants to change the modifier of  aUIXButton to final & I don't want to do
that.

Does anyone know how can I fix this?

Thank you,

-- 

2. Do static variables of an ApplicationContext subclass left untouched when the process is killed?

Do static variables of an ApplicationContext subclass left untouched
when the process is killed?

-- 

3. How to check if a user defined service is already running

4. ListView issue (Editors?)

5. multiple instances of media player

6. PV Opencore call chain

7. Crash on gesture recognize