How to support multiple android version in your code?

前端 未结 8 638
名媛妹妹
名媛妹妹 2020-12-01 11:01

Take accessing contacts in android android.jar for versions 1.6 has People.CONTENT_URI for invoking contacts related info whereas in later versions we need to have api suppo

8条回答
  •  猫巷女王i
    2020-12-01 11:27

    There's a nice article on android.com about it: http://developer.android.com/resources/articles/backward-compatibility.html

    Personally I would suggest the wrapper class or wrapper library solution. But in small cases the reflection should be fine (and in case performance is not a problem for you).

    If you need more info, ask in comments.

提交回复
热议问题