android 高版本函数actionBarSetup()要在低版本使用设置方法VERSION_CODES

/**
* Android 1.5:Cupcake(杯子蛋糕)
   * Android 1.6:Donut(甜甜圈)
   * Android 2.0 / 2.1:Eclair(闪电泡芙)
   * Android 2.2:Froyo(冷冻忧格)
   * Android 2.3:Gingerbread(姜饼)
   * Android 3.0:Honeycomb(蜂巢)

*/


介绍:VERSION_CODES  ------------这个是客户使用版本名字编码

SDK_INT ----------这个是当前的版本号编码


//函数案例

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void actionBarSetup() {

if(Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB){

......

}

}

//对于关系如下表格

int  1 (0x00000001) BASE October 2008: The original, first, version of Android.
int  2 (0x00000001) BASE_1_1 February 2009: First Android update, officially called 1.1.
int  3 (0x00000001) CUPCAKE May 2009: Android 1.5.
int  10000 (0x00002710) CUR_DEVELOPMENT Magic version number for a current development build, which has not yet turned into an official release.
int  5 (0x00000001) DONUT September 2009: Android 1.6.
int   ECLAIR November 2009: Android 2.0
  Applications targeting this or a later release will get these new changes in behavior:
 5 (0x00000008) The Service.onStartCommand function will return the new START_STICKY behavior instead of the old compatibility START_STICKY_COMPATIBILITY.
int  6 (0x00000008) ECLAIR_0_1 December 2009: Android 2.0.1
int  7 (0x00000008) ECLAIR_MR1 January 2010: Android 2.1
int  8 (0x00000008) FROYO June 2010: Android 2.2
int   GINGERBREAD November 2010: Android 2.3
  Applications targeting this or a later release will get these new changes in behavior:
 9 (0x00000009) The application's notification icons will be shown on the new dark status bar background, so must be visible in this situation.
int  10 (0x0000000a) GINGERBREAD_MR1 February 2011: Android 2.3.3.
int  11 (0x0000000b) HONEYCOMB February 2011: Android 3.0.
int  12 (0x0000000c) HONEYCOMB_MR1 May 2011: Android 3.1.
int  13 (0x0000000d) HONEYCOMB_MR2 June 2011: Android 3.2.
int  14 (0x0000000e) ICE_CREAM_SANDWICH October 2011: Android 4.0.
int  15 (0x0000000f) ICE_CREAM_SANDWICH_MR1 December 2011: Android 4.0.3.
int  16 (0x00000010) JELLY_BEAN Android 4.1.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值