Android 5.0 Build.version_codes Invalid

Source: Internet
Author: User

now the Android 5.0 API internal processing mechanism is more confused. If my Android app compiles with Android version 5.0, the compiled app can be run on Android 5.0 and later. if configured in development (build.version.sdk_int>= Build.version_codes. LOLLIPOP) still works, if running on other older devices (Android version older), the device is not given to Build.version_codes. LOLLIPOP definition, if you can run build.version.sdk_int>= build.version_codes in a common way. LOLLIPOP This piece of code?

Processing methods

How do I run this piece of code on an unsupported old device?

Simple: You don't need to set a variable
Build.version_codes. LOLLIPOP the final static int value, which calls Build.version_codes directly when it is run. LOLLIPOP corresponds to the specific int value, if you write the value in your program as a specific int value.

For example, in the Android 5.0 version, you get a specific int value from the console output, and then write it directly in your program, so you can run it in the old Android version.


Original address: http://www.itmmd.com/201411/183.html
This article by Meng Meng's IT person to organize the release, reprint must indicate the source.

Android 5.0 Build.version_codes Invalid

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.