How to support multiple android version in your code?

前端 未结 8 612
名媛妹妹
名媛妹妹 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条回答
  • 2020-12-01 11:32

    If on Eclipse, from ADT version 17 you can specify code to run with some version simply as described in Lint API Check. The code word is @TargetAPI(XX)

    Hope it helps

    0 讨论(0)
  • 2020-12-01 11:38

    This is a great article for when you have to do reflection in Android (to support multiple API levels).

    And when you have to have different resources for different API Levels, this is the reference to use (see the section on "Platform Version (API level)").

    0 讨论(0)
提交回复
热议问题