Android Dalvik Verification in Eclair

后端 未结 1 436
攒了一身酷
攒了一身酷 2021-01-23 22:37

I have recently been looking at handling API levels fragmentation and found a great tutorial on supporting different API Levels in your source code:

As stated in the tut

1条回答
  •  一向
    一向 (楼主)
    2021-01-23 22:58

    Starting with Android 2.0 the Dalvik verifier is smarter about only checking classes that are actually used while running.

    That said, the code you show here would only work if you never touch the CameraActivity class when running on older versions of the platform. Given that isn't what you are showing, an explanation may be that on some older builds of the platform that API was there but not yet available in the SDK.

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