ActionBar pre Honeycomb

后端 未结 7 1490
你的背包
你的背包 2020-12-03 00:04

I am writing an app for android (2.1 > 3.1) and I would like to use the familiar practice of using the app Icon in Honeycomb apps to go up to the home activity, however, whe

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 00:43

    I think the code is self-explanatory

    private static int sdkVersion;
     static 
     {
        try {
          sdkVersion = Integer.parseInt(android.os.Build.VERSION.SDK);
        } catch (Exception ex) {
        }
      }
    
      /** Device support the froyo (Android 2.2) APIs */
      public static boolean isAndroid22() {
        return sdkVersion >= 8;
      }
    
      /** Device support the Gingerbread (Android 2.3) APIs */
      public static boolean isAndroid23() {
        return sdkVersion >= 9;
      }
    
      /** Device supports the Honeycomb (Android 3.0) APIs */
      public static boolean isAndroid30() {
        return sdkVersion >= 11;
      }
    

提交回复
热议问题