Checking Android version

Posted by John Smith on Stack Overflow See other posts from Stack Overflow or by John Smith
Published on 2012-08-31T09:19:22Z Indexed on 2012/08/31 9:38 UTC
Read the original article Hit count: 193

Filed under:
|

I need if the phone running the app api level is 14 which is android 4.0 or more ( example api levcel 15 ) then startActivity ... else if the api level is lower than 14 ( example 13 ), then startActivity ...

                String AndroidVersion = android.os.Build.VERSION.RELEASE;
                if ( AndroidVersion == 4.0 ) {
                    Intent start = new Intent(S.this, Menu.class);
                    startActivity(start);                       
                }
                else {
                    Intent startt = new Intent(S.this, Menu2.class);
                    startActivity(startt);
                }

whats the wrong ?

© Stack Overflow or respective owner

Related posts about android

Related posts about version