Java tutorial
//package com.java2s; //License from project: Open Source License import android.annotation.TargetApi; import android.os.Build; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; import android.view.View; public class Main { @TargetApi(Build.VERSION_CODES.HONEYCOMB) public static void disableHardwareAcceleration(View view) { // HA was introduced in Honeycomb. if (isHoneycomb()) view.setLayerType(View.LAYER_TYPE_SOFTWARE, null); } /** * Returns true if the device has Honeycomb (3.0) or greater installed. */ public static boolean isHoneycomb() { return isApiLevel(VERSION_CODES.HONEYCOMB); // Android 3.0, API Level 11. } /** * Returns true if the device supports the specified API level (or greater). */ public static boolean isApiLevel(int apiLevel) { return (VERSION.SDK_INT >= apiLevel); } }