Android Adobe工具类

public class AdobeUtil {

    /** * 安装flash插件 */
    public static void installAdobe(final Context context) {
        new AlertDialog.Builder(context).setTitle("安装flash插件").setPositiveButton("确定", new OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                Intent intent = new Intent("android.intent.action.VIEW");
                intent.setData(Uri.parse("market://details?id=com.adobe.flashplayer"));
                context.startActivity(intent);
                ((Activity)context).finish();
            }
        }).setNegativeButton("取消", new OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
            }
        }).show();
    }

    /** * 是否安装了flash插件 * * @return */
    public static boolean checkAdaboe(Context context) {
        PackageManager pm = context.getPackageManager();
        List<PackageInfo> packages = pm.getInstalledPackages(PackageManager.GET_SERVICES);
        for (PackageInfo pi : packages) {
            if ("com.adobe.flashplayer".equals(pi.packageName)) {
                return true;
            }
        }
        return false;
    }
}

你可能感兴趣的:(android,Adobe)