Compatibility for Java library methods that require Android API level 9? -


some java library methods decimalformat.setroundingmode have @since 1.6 entry in documentation.

/** ...  * @since 1.6  */ public void setroundingmode(roundingmode roundingmode) { ... } 

when tried use method compiled under android 4.2.2 , jdk 1.6 android:minsdkversion set 7 shown,

mynumberformat.setroundingmode(roundingmode.down); 

android lint underlined setroundingmode in red me , told me that

call requires api level 9 (current min 7): java.text.numberformat#setroundingmode 

how , why can android api restrict java library methods can , cannot use? cleaned project , lint error disappeared. project compiled no errors , ran on device running android 2.2.3 (api 8).
program crashed with:

05-09 11:32:38.436: e/androidruntime(2074): caused by: java.lang.nosuchmethoderror: java.text.numberformat.setroundingmode 

the android documentation confirms setroundingmode, copysign, , others added in api level 9. does mean devices running android os level 8 , below compiled/built jdk 1.5?

and can understand that. but impossible android support library (or else) allow use these methods?

related rounding half decimal format in android


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -