Hi John, any time a device configuration change during runtime
(orientation in this case) Android automatically kills the
Activity( calls onDestroy() ) and start it again (call onCreate() ) so
the changes are applied (read more about this behavior here
http://developer.android.com/guide/topics/resources/runtime-changes.html
).

Bellow I explain a way to override this, there are other way to do it,
this is the most simpler, let me know if it fit your requirements:


Inside the Activity override this method:

@Override
public void onConfigurationChanged(Configuration newConfig) {
     super.onConfigurationChanged(newConfig);
     //Put everything you want to change here
}

Inside the AndroidManisfest put this attribute in your Activity tag:

<activity ... android:configChanges="orientation|keyboardHidden" ... >



On Oct 30, 12:01 pm, John Goche <[email protected]> wrote:
> Hello,
>
> I was wondering whether there is a way to prevent an
> application from redrawing itself when the user tilts the
> phone's screen from portrait to landscape.
>
> Thanks,
>
> John Goche

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to