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. Temperature Sensors

Greetings,

I can't seem to find this info on the droids temperature sensor (the
one available in the SDK):

Does it indicate ambient temperature or is it the temperature of the
phone or chip?

Also, does the pressure sensor indicate atmospheric pressure?

regards,

Sam

-- 

2. "Failed to load wifi driver" from application

Hi all,

  I am using android on beagleboard and enabled the wifi on the board
using DLink 110 adapter. It works fine when enabling the wifi
manually.

  I had enable usb to Wifi (ralink) driver in the linux kernel.

  Now I want to enable the same and connect with ssid using Android
Applications and APIs ( WifiManager, WifiConfiguration etc.). I have
also given required permissions.

 But when I am doing so I am getting error in the logcat saying "
Failed to load Wifi driver" ( same as in the emulator)

 So my doubt is whether it is searching the inbuilt wifi driver, as my
driver is USB to WiFi. What can be the solution?? My java code is as
follows,

----------------------------------------------------
final WifiManager wifi = (WifiManager)getSystemService(service1);
        if (!wifi.isWifiEnabled())
                if (wifi.getWifiState() != WifiManager.WIFI_STATE_ENABLING)
                wifi.setWifiEnabled(true);
        wifiConfiguration = new WifiConfiguration();
        wifiConfiguration.SSID ="ready";
        wifiConfiguration.priority= 1;
        wifiConfiguration.allowedAuthAlgorithms.set
(WifiConfiguration.AuthAlgorithm.OPEN);
        wifiConfiguration.allowedKeyManagement.set(KeyMgmt.NONE);
        wifiConfiguration.allowedGroupCiphers.set
(WifiConfiguration.GroupCipher.TKIP);
        wifiConfiguration.status = WifiConfiguration.Status.ENABLED;
        wifiConfiguration.networkId = wifi.addNetwork
(wifiConfiguration);
        wifi.enableNetwork(wifiConfiguration.networkId, true);

-------------------------------------------------

Thanks in advance...
Asif

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Missing shared preference data

4. Help about Alarm Clock

5. Oot: om google dibilang boong

6. Oot: om google dibilang boong

7. Bug fix on android 2.1