Code such as :
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD)
ed.apply();
else ed.commit();
produces a warning in Froyo :
04-27 03:40:35.025: W/dalvikvm(3138): VFY: unable to resolve interface method 219: Landroid/content/SharedPreferences$Editor;.apply ()V
But I understand that in older devices this would be a RuntimeError which would abort the application (see here and here).
So is this way of conditionally calling new API (methods) safe in API 8 (Froyo) and above or there are cases where lazy loading is still needed ?
What changes on Dalvik made this possible ?
Related