Reputation: 3924
I'm using the version handling and conditioning it but getting an error as:
Unknown Class 'android.os.Build.VERSION.SDK_INT'
This is my code:
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
//TODO
}
Upvotes: 1
Views: 2199
Reputation: 3924
Well, I updated my Android Studio and other SDK Tools and now it works fine. Maybe a wrong configuration or a file change caused the issue.
Upvotes: 0
Reputation: 83
I had this problem and fixed it by moving the code into the onCreate method of the activity.
Upvotes: 3