[android-developers] Re: version-specific attributes in AndroidManifest.xml
Thanks - that worked! On Jul 22, 3:36 pm, nadam a...@anyro.se wrote: I don't think there is any way to do that in the manifest. However, you can remove android:screenOrientationfrom the manifest and set it in the activity's onCreate() method instead: if (Build.VERSION.SDK_INT Build.VERSION_CODES.GINGERBREAD) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); else setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); On 20 Juli, 20:43,thedudegil.car...@gmail.com wrote: Is there a way to have different valued attributes in the manifest, depending on platform version? For example, for 2.3 and above, I would like to specify: android:screenOrientation=sensorLandscape For 2.2 and below, I would like to specify android:screenOrientation=landscape I want to use a 2.3 build target, but for the application be able to run (and be locked to landscape) on 2.2 and below. Thanks! -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: version-specific attributes in AndroidManifest.xml
I don't think there is any way to do that in the manifest. However, you can remove android:screenOrientation from the manifest and set it in the activity's onCreate() method instead: if (Build.VERSION.SDK_INT Build.VERSION_CODES.GINGERBREAD) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); else setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); On 20 Juli, 20:43, thedude gil.car...@gmail.com wrote: Is there a way to have different valued attributes in the manifest, depending on platform version? For example, for 2.3 and above, I would like to specify: android:screenOrientation=sensorLandscape For 2.2 and below, I would like to specify android:screenOrientation=landscape I want to use a 2.3 build target, but for the application be able to run (and be locked to landscape) on 2.2 and below. Thanks! -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en