当前位置: 首页>>代码示例>>Java>>正文


Java VERSION.SDK_INT属性代码示例

本文整理汇总了Java中android.os.Build.VERSION.SDK_INT属性的典型用法代码示例。如果您正苦于以下问题:Java VERSION.SDK_INT属性的具体用法?Java VERSION.SDK_INT怎么用?Java VERSION.SDK_INT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.os.Build.VERSION的用法示例。


在下文中一共展示了VERSION.SDK_INT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: requestPermissions

public static void requestPermissions(@NonNull final Activity activity, @NonNull final String[] permissions, final int requestCode) {
    if (VERSION.SDK_INT >= 23) {
        ActivityCompatApi23.requestPermissions(activity, permissions, requestCode);
    } else if (activity instanceof OnRequestPermissionsResultCallback) {
        new Handler(Looper.getMainLooper()).post(new Runnable() {
            public void run() {
                int[] grantResults = new int[permissions.length];
                PackageManager packageManager = activity.getPackageManager();
                String packageName = activity.getPackageName();
                int permissionCount = permissions.length;
                for (int i = 0; i < permissionCount; i++) {
                    grantResults[i] = packageManager.checkPermission(permissions[i], packageName);
                }
                ((OnRequestPermissionsResultCallback) activity).onRequestPermissionsResult(requestCode, permissions, grantResults);
            }
        });
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:18,代码来源:ActivityCompat.java

示例2: postOnAnimation

public static void postOnAnimation(View view, Runnable runnable) {
	if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
		SDK16.postOnAnimation(view, runnable);
	} else {
		view.postDelayed(runnable, 16);
	}
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:7,代码来源:ViewCompat.java

示例3: postOnAnimation

public static void postOnAnimation(View view, Runnable runnable) {
	if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
		SDK16.postOnAnimation(view, runnable);
	} else {
		view.postDelayed(runnable, SIXTY_FPS_INTERVAL);
	}
}
 
开发者ID:starn,项目名称:encdroidMC,代码行数:7,代码来源:Compat.java

示例4: getPersistentNotification

public Notification getPersistentNotification() {
    PendingIntent pendingIntent = PendingIntent.getBroadcast(this.context, 0, new Intent(INTENT_ACTION_LAUNCH_SHADE), 0);
    RemoteViews content = new RemoteViews(BuildConfig.APPLICATION_ID, R.layout.persistent_notification);
    String notificationTitle = this.context.getResources().getString(R.string.persistent_notification_title);
    String notificationContent = this.context.getResources().getString(R.string.persistent_notification_text);
    int priority = Integer.MIN_VALUE;
    int smallIconId = 17170445;
    long when = Long.MIN_VALUE;
    if (this.hasPendingMessages) {
        notificationContent = this.context.getResources().getString(R.string.persistent_notification_with_messages_text);
        if (VERSION.SDK_INT <= 19) {
            priority = 1;
        }
        if (!(this.lockScreenManager.isPhoneLocked() || this.lockScreenManager.isScreenOff())) {
            when = System.currentTimeMillis();
            priority = 1;
        }
        smallIconId = R.drawable.ic_notification_small;
    }
    priority=Notification.PRIORITY_MIN;
   // builder.setPriority(Notification.PRIORITY_MIN);
    content.setTextViewText(R.id.notification_title_textview, notificationTitle);
    content.setTextViewText(R.id.notification_content_textview, notificationContent);
    return new Builder(this.context).setPriority(priority).setContentIntent(pendingIntent).setSmallIcon(smallIconId).setContent(content).setWhen(when).setOngoing(true).build();
}
 
开发者ID:bunnyblue,项目名称:NoticeDog,代码行数:25,代码来源:NotificationTrayManager.java

示例5: f

static String f(String str) {
    if (str == null) {
        return null;
    }
    if (VERSION.SDK_INT < 8) {
        return str;
    }
    try {
        return new String(g.c(Base64.decode(str.getBytes("UTF-8"), 0)), "UTF-8").trim()
                .replace("\t", "").replace("\n", "").replace("\r", "");
    } catch (Throwable th) {
        a("decode error", th);
        return str;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:15,代码来源:h.java

示例6: determineYPositionOfGoogleStyleViewLayout

private void determineYPositionOfGoogleStyleViewLayout() {
	if ( VERSION.SDK_INT < VERSION_CODES.ICE_CREAM_SANDWICH ) { 
		mYPositionOfGoogleStyleViewLayout = 0;
	} else {
		mYPositionOfGoogleStyleViewLayout = mStatusBarHeight;
	}
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:7,代码来源:PullToRefreshBase.java

示例7: setStatusBarTransparent

protected void setStatusBarTransparent() {
    if (VERSION.SDK_INT >= 19) {
        requestWindowFeature(9);
        requestWindowFeature(10);
        getWindow().getDecorView().setSystemUiVisibility(1280);
        getWindow().addFlags(67108864);
        LOG.d(TAG, "VERSION.SDK_INT =" + VERSION.SDK_INT);
        return;
    }
    LOG.d("CP_Common", "SDK < 19");
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:BasicActivity.java

示例8: create

public static LightAlertDialog create(Context context) {
    if (VERSION.SDK_INT >= 14) {
        return new LightAlertDialog(context, 3);
    }
    LightAlertDialog dialog = new LightAlertDialog(context);
    dialog.setInverseBackgroundForced(true);
    return dialog;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:LightAlertDialog.java

示例9: setVersionName

public static void setVersionName(String str) {
    if (VERSION.SDK_INT < 10) {
        ib.b(a, "Device SDK Version older than 10");
    } else if (str == null) {
        ib.b(a, "String versionName passed to setVersionName was null.");
    } else {
        je.a().a("VersionName", (Object) str);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:9,代码来源:FlurryAgent.java

示例10: setBackground

public static void setBackground(View view, Drawable background) {
	if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
		SDK16.setBackground(view, background);
	} else {
		view.setBackgroundDrawable(background);
	}
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:7,代码来源:ViewCompat.java

示例11: onConfigurationChanged

protected void onConfigurationChanged(Configuration newConfig) {
    if (VERSION.SDK_INT >= 8) {
        super.onConfigurationChanged(newConfig);
    }
    TypedArray a = getContext().obtainStyledAttributes(null, R.styleable.ActionBar, R.attr.actionBarStyle, 0);
    setContentHeight(a.getLayoutDimension(R.styleable.ActionBar_height, 0));
    a.recycle();
    if (this.mActionMenuPresenter != null) {
        this.mActionMenuPresenter.onConfigurationChanged(newConfig);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:AbsActionBarView.java

示例12: createRefreshableView

@Override
protected ExpandableListView createRefreshableView(Context context, AttributeSet attrs) {
	final ExpandableListView lv;
	if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
		lv = new InternalExpandableListViewSDK9(context, attrs);
	} else {
		lv = new InternalExpandableListView(context, attrs);
	}

	// Set it to this so it can be used in ListActivity/ListFragment
	lv.setId(android.R.id.list);
	return lv;
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:13,代码来源:PullToRefreshExpandableListView.java

示例13: onDraw

@Override
public void onDraw(Canvas canvas) {
    if (mBackground != null) {
        // Draw the background filling parts not covered by the illustration
        canvas.save();
        canvas.translate(0, mIllustrationBounds.height());
        // Scale the background so its size matches the foreground
        canvas.scale(mScale, mScale, 0, 0);
        if (VERSION.SDK_INT > VERSION_CODES.JELLY_BEAN_MR1 &&
                shouldMirrorDrawable(mBackground, getLayoutDirection())) {
            // Flip the illustration for RTL layouts
            canvas.scale(-1, 1);
            canvas.translate(-mBackground.getBounds().width(), 0);
        }
        mBackground.draw(canvas);
        canvas.restore();
    }
    if (mIllustration != null) {
        canvas.save();
        if (VERSION.SDK_INT > VERSION_CODES.JELLY_BEAN_MR1 &&
                shouldMirrorDrawable(mIllustration, getLayoutDirection())) {
            // Flip the illustration for RTL layouts
            canvas.scale(-1, 1);
            canvas.translate(-mIllustrationBounds.width(), 0);
        }
        // Draw the illustration
        mIllustration.draw(canvas);
        canvas.restore();
    }
    super.onDraw(canvas);
}
 
开发者ID:Trumeet,项目名称:SetupWizardLibCompat,代码行数:31,代码来源:Illustration.java

示例14: createListView

protected ListView createListView(Context context, AttributeSet attrs) {
	final ListView lv;
	if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
		lv = new InternalListViewSDK9(context, attrs);
	} else {
		lv = new InternalListView(context, attrs);
	}
	return lv;
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:9,代码来源:PullToRefreshListView.java

示例15: onPause

public void onPause() {
    if (this.b != null && VERSION.SDK_INT >= 11) {
        this.b.onPause();
    }
    if (this.c != null && VERSION.SDK_INT >= 11) {
        this.c.onPause();
    }
    if (m.a().y()) {
        MWConfiguration.getContext().sendBroadcast(new Intent("com.magicwindow.webview.pause" +
                ".MW_MESSAGE"));
    }
    TrackAgent.currentEvent().onWebviewPause(this.e, this.d);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:13,代码来源:WebViewActivity.java


注:本文中的android.os.Build.VERSION.SDK_INT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。