Reputation: 62559
I installed emulator for Marshmallow (MNC) but when I call Build.VERSION.SDK_INT it's returning to me 22. It has the functionality of MNC because it has runtime permissions etc and the calls work but it's just the build version that's off. How can this be resolved.
So to be clear, the code Build.VERSION.SDK_INT
returns 22 on a api 23 emulator, why?
Upvotes: 0
Views: 1251
Reputation: 8063
I think it depends on the Preview version on the emulator. I had the same effect on my Nexus 6 device. After M Preview 3 update the correct version (23) was returned, for former versions it was 22.
My workaround was to check for RELEASE attribute, which was "M" and on Preview 3 "Marshmallow" will be returned.
Upvotes: 1