Android deprecated method backward-compatible
My app uses a method that was deprecated since Android 2.1 with a different method and I would like to make it work from 1.5 to 2.2. Is there a way for my app to determine which Android version the user has and call the correct method based on that? Or is there a better way to do开发者_Python百科 this?
you can check the device SDK version using inbuilt classes available in Android and then put a if else condition around it.But i am not sure if its the recommended approach...
int sdkversion= Build.VERSION.SDK_INT;
精彩评论