produces a warning in Froyo
This is perfectly normal.
But I understand that in older devices this would be a RuntimeError which would abort the application
For Android 1.x, yes.
So is this way of conditionally calling new API (methods) safe in API 8 (Froyo) and above
Yes.
What changes on Dalvik made this possible ?
It no longer "fails fast" when encountering an unidentified symbol, but instead waits to try again to resolve it when the statement is executed. By checking SDK_INT
and ensure that the statement is not executed, you don't crash.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…