Bug 5959 - Android.Content.PM.ConfigChanges enum missing ScreenSize and SmallestScreenSize values
Summary: Android.Content.PM.ConfigChanges enum missing ScreenSize and SmallestScreenSi...
Status: RESOLVED FEATURE
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-07-02 21:39 UTC by Redth
Modified: 2012-11-29 12:33 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FEATURE

Description Redth 2012-07-02 21:39:33 UTC
According to the docs, the ScreenSize and SmallestScreenSize values are missing from the Android.Content.PM.ConfigChanges enum

http://developer.android.com/guide/topics/manifest/activity-element.html#config
Comment 1 Atsushi Eno 2012-07-05 03:08:16 UTC
They exists only in higher API Level (note that they were introduced at API Level 13).
http://androidapi.xamarin.com/?link=T%3aAndroid.Content.PM.ConfigChanges

I assume that you are not seeing those enum values because your TargetFramework is lower than that.
Comment 2 Goncalo Oliveira 2012-11-29 06:19:28 UTC
I believe this is still an issue.
It's true that these settings were introduced in API 13, but, if the project is targeting at least API 13, even if minimum is lower, these settings should be available.

I do have such a scenario, and currently have to use force fast the value

ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.KeyboardHidden | (ConfigChanges)0x0400

My minimum is API 10 but target is API 15.
Comment 3 Goncalo Oliveira 2012-11-29 06:22:57 UTC
layoutDirection (0x2000) is also missing.
Comment 4 Jonathan Pryor 2012-11-29 10:25:47 UTC
@Goncalo: Are you using MonoDevelop or Visual Studio?

MonoDevelop allows separately specifying the minimum SDK and the target SDK within the IDE; Visual Studio does not (Bug #6221). Visual Studio thus requires hand-editing the AndroidManifest.xml to specify the minimum SDK version when it doesn't match the target SDK version.
Comment 5 Goncalo Oliveira 2012-11-29 11:46:28 UTC
I'm using Visual Studio (2012 - but behavior was the same with 2010).

I do have a manifest file, where I specify the minimum and target versions.

  <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15" />
Comment 6 Jonathan Pryor 2012-11-29 12:33:32 UTC
> I 'm using Visual Studio

What's your $(TargetFrameworkVersion)? Specifically, if you view your Project Properties and go to the Application tab, what is the Minimum Android to target?

Despite the fact it has "Minimum" in the label, this is the $(TargetFrameworkVersion) (and provides the default //uses-sdk/@android:targetSdkVersion value if not otherwise provided). $(TargetFrameworkVersion) controls which Mono.Android.dll is used for compilation. If this is set to Android 2.2 (the default), then the compiler will not show you members added after API 8.

If you want to use members added in API-13, you need to set $(TargetFrameworkVersion) ("Minimum Android to target") to Android 4.0.