Android eclipse if/else problems -


i wanted app check build version , open activity wrote code:

if (build.version.sdk_int) >= build.version_codes.lollipop) ... 

and rest worked. want use else run activity when build version isn't lollipop

what should ?

i mean unequal , equal , more than/ less symbols?

try code less lollipop version:

if (build.version.sdk_int<21)         {           //your code version less lollipop           } 

use below table check version.

sdk_int value        build.version_codes        human version name            1                  base                      android 1.0 (no codename)     2                  base_1_1                  android 1.1 petit 4     3                  cupcake                   android 1.5 cupcake     4                  donut                     android 1.6 donut      5                  eclair                    android 2.0 eclair      6                  eclair_0_1                android 2.0.1 eclair                        7                  eclair_mr1                android 2.1 eclair      8                  froyo                     android 2.2 froyo      9                  gingerbread               android 2.3 gingerbread     10                  gingerbread_mr1           android 2.3.3 gingerbread     11                  honeycomb                 android 3.0 honeycomb     12                  honeycomb_mr1             android 3.1 honeycomb     13                  honeycomb_mr2             android 3.2 honeycomb     14                  ice_cream_sandwich        android 4.0 ice cream sandwich     15                  ice_cream_sandwich_mr1    android 4.0.3 ice cream sandwich     16                  jelly_bean                android 4.1 jellybean     17                  jelly_bean_mr1            android 4.2 jellybean     18                  jelly_bean_mr2            android 4.3 jellybean     19                  kitkat                    android 4.4 kitkat     20                  kitkat_watch              android 4.4 kitkat watch     21                  lollipop                  android 5.0 lollipop     22                  lollipop_mr1              android 5.1 lollipop    10000                cur_development           current development build  

Comments