Wednesday, August 10, 2011

Re: [android-developers] opening physical keyboard restarting my app

On Wed, Aug 10, 2011 at 2:01 PM, David Toledo <dtoledos@gmail.com> wrote:
> How to prevent opening physical keyboard restarting the app. I've test with
> the following code:
>
> android:screenOrientation="portait"
> android:configChanges="keyboardHidden|orientation|keyboard"
>
> but no resolve my problem

Ideally, you write your activities to handle configuration changes.
Bear in mind that you aren't handling dock events, the new
rotation-based stuff for Android 3.2+, locale changes, or other
configuration changes. Your app will break for all of those too.

You have "portrait" misspelled.

Beyond that, your configChanges seems fine. But, again, ideally you
get rid of both the screenOrientation and the configChanges attributes
and support both orientations, using onSaveInstanceState() and
onRetainNonConfigurationInstance() (or, if you are using fragments,
using setRetainInstance(true) with those).

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

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

No comments:

Post a Comment