I am developing several widgets
No, you are developing several application widgets . Although I am sorry that these terms are confusing, it is very important for you to use the correct terminology in your question.
One of them uses ListView, but ListView is not supported by Android 2.3.
Correctly, ListView not supported in application widgets in Android 2.3 or lower.
So, if my application is installed in Android 2.3, then the widget with ListView should not be displayed in the list of widgets.
Step # 1: create a res/values/bools.xml that defines a logical resource with the name is_honeycomb and false .
Step # 2: create a res/values-v11/bools.xml defining another logical resource with the same name ( is_honeycomb ) and true
Step # 3: In your manifest, in the <receiver> element for the AppWidgetProvider that uses the ListView , add android:enabled="@bool/is_honeycomb" .
The net effect is that on Android 3.0+ devices your ListView widget will be available, but on Android 2.3 and lower devices it will not.
source share