Friday, November 25, 2011

[android-developers] Where do we use uses-feature android:required="false"?

I have a question:

If I wanted to support a feature (says camera) but it is not necessary
(menu item removed if detected no), is it necessary to declare:

<uses-feature android:name="string" android:required="false"/>

I assume we can simply do this without declaring. Isn't it? Or is it
just good practice but not necessary?

PackageManager packageManager = getPackageManager();
if (!
packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA))
menu.removeItem(R.id.camera);

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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment