Yes

Do note that some API calls will throw Exceptions on Froyo.  To avoid this, 
use Reflections

For example: my app supports from Froyo upward, but Froyo does not support 
icons on the Preference Activity.  So I use this to set the icon for ICS, 
and skip the step on Froyo

 void workAroundSetPicture(Preference pref, int resource){
    try {
Method m = pref.getClass().getMethod("setIcon", int.class);
m.invoke( pref,  resource );
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
    }

The top right corner on the Android Developer documentation mentions for 
which Version the methods were introduced.

On Wednesday, August 1, 2012 10:27:06 AM UTC-4, Eric oboite wrote:
>
> When creating my new app should I build against 2.2 or 4.1? I know 2.2 has 
> 83% of the market right now but can I build against 4.1 and make the min 
> sdk android 2.0?
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to