Device lifecycle : rotating the phone causes app problems

Today I will spend most of the time on stabilization. However one of issues is when device is rotated (90 degrees) which causes  loss of the image on a drilldown screen.

Relevant info:

1. Applications that match sensor data to on-screen display must always useandroid.view.Display.getRotation() to map sensor coordinates to screen coordinates

Deep explanation of imaging data with screen ration is http://android-developers.blogspot.com/2010/09/one-screen-turn-deserves-another.html but it seems as overkill for me now.

2. Handling configuration changes http://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange also seems as overkill

3. this seems a good explanation

<activity android:name=".MyActivity"
          android:configChanges="orientation"
          android:label="@string/app_name">

Now when one of these configurations change, MyActivity is not restarted. Instead, the Activity receives a call to onConfigurationChanged().

Implemented onConfigurationChanged() but it’s not called. Instead onCreate() is called each time device orientation is changed. Go figure.

4. Found this article with better explanation http://developer.android.com/guide/topics/resources/runtime-changes.html they say to override OnSaveInstanceState. This makes more sense.  This one is the winner.

 

 

4. Friend pointed to this cool software https://www.desktopanywhere.com/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s