0

I have just found out that, I have a piece of code which doesn't work on android 4.4.4 so I don't want to run that and I want to have a if else condition for it however when I try to check through the code it does not work, even I know because android 4.4.4 and android 4.4.2 both are of API 19.

My question is how to differentiate?

Matt
  • 14,906
  • 27
  • 99
  • 149
Saty
  • 2,563
  • 3
  • 37
  • 88

1 Answers1

0

Use following code :

if(Build.VERSION.SDK_INT == Build.VERSION_CODES.HONEYCOMB){ }

However Build.VERSION.RELEASE will give the exact string!!

Saty
  • 2,563
  • 3
  • 37
  • 88
Varun Verma
  • 542
  • 4
  • 17
  • Varun Bhai....I have to check the Build.VERSION.Release to get it done cause 4.4.2 and 4.4.4 both are KitKat. Am I right? – Saty Nov 03 '15 at 09:54
  • Yes, basically look at the class Build.VERSION where you can find this info – Varun Verma Nov 03 '15 at 09:59