How to hide Widget If not supported by Android API? -
developing multiple widgets, 1 of them uses listview listview not supported android 2.3.
so, if app installed in android 2.3 @ time widget listview should not display in widget's list.
widget listview showing in widget's list , if click on shows me force closed.
that's why want hide widgets widget's list.
if 1 has suggestions please reply.
shows me force closed , following error widget
same widget run in android 4.2 shows me per following list
thank you.
i developing multiple widgets
no, developing multiple app widgets. while sorry terms confusing, important use right terminology in question.
one of them uses listview listview not supported android 2.3.
correct, listview
not supported in app widgets in android 2.3 or lower.
so, if app installed in android 2.3 @ time widget listview should not display in widget's list.
step #1: create res/values/bools.xml
file, defining boolean resource, name of is_honeycomb
, , value of false
.
step #2: create res/values-v11/bools.xml
file, defining boolean resource, same name (is_honeycomb
), , value of true
step #3: in manifest, on <receiver>
element appwidgetprovider
uses listview
, add android:enabled="@bool/is_honeycomb"
.
the net effect on android 3.0+ devices, listview
app widget available option, on android 2.3 , lower devices, not.
Comments
Post a Comment