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. [WTA] help gimana caranya uninstall

bingung nih suhu...aplikasi udah diuninstall dari device tapi kenapa
masih installed di webnya android market  yah???
akibatnya ga bisa install aplikasi tsb...gimana nih....bingung....hehehe

salam


Noganz

-- 
===============

2. Budget 2,5 - 3.0 pilih SAMSUNG ACE atau ada rekomendasi lain.please help

Sesuai subjek nya
Gimana nih..
Masih ragu mau beli samsung ace...
Pengen dengar pendapat teman teman dulu nih...
Tolong dibantu ya....

Makasih

-- 
===============

3. why can't catch the SocketTimeoutException

4. Set wallpaper from webview

5. Multiple content providers to sync...

6. [WTS] titipan temen Samsung Galaxy Spica hitam 2nd

7. Benchmark Test: HTC Pyramid vs. LG Optimus 2X