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


Java Intent.ACTION_DELETE属性代码示例

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


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

示例1: uninstallNormal

/**
 * 卸载App
 *
 * @param context
 * @param packageName
 * @return
 */
public static boolean uninstallNormal(Context context, String packageName) {
    if (packageName == null || packageName.length() == 0) {
        return false;
    }

    Intent i = new Intent(Intent.ACTION_DELETE, Uri.parse(new StringBuilder().append("package:")
            .append(packageName).toString()));
    i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(i);
    return true;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:Kits.java

示例2: uninstallApk

/**
 * 调用系统卸载应用
 */
public static void uninstallApk(Context context, String packageName) {
    Intent intent = new Intent(Intent.ACTION_DELETE);
    Uri packageURI = Uri.parse("package:" + packageName);
    intent.setData(packageURI);
    context.startActivity(intent);
}
 
开发者ID:androidDaniel,项目名称:treasure,代码行数:9,代码来源:PackageUtil.java

示例3: uninstall

/** 卸载一个app */
public static void uninstall(Context context, String packageName) {
    //通过程序的包名创建URI
    Uri packageURI = Uri.parse("package:" + packageName);
    //创建Intent意图
    Intent intent = new Intent(Intent.ACTION_DELETE, packageURI);
    //执行卸载程序
    context.startActivity(intent);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:ApkUtils.java

示例4: getUninstallAppIntent

/**
 * 获取卸载App的意图
 *
 * @param packageName 包名
 * @return intent
 */
public static Intent getUninstallAppIntent(String packageName)
{
    Intent intent = new Intent(Intent.ACTION_DELETE);
    intent.setData(Uri.parse("package:" + packageName));
    return intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
 
开发者ID:Ayvytr,项目名称:EasyAndroid,代码行数:12,代码来源:IntentTool.java

示例5: uninstallApk

/**
 * 卸载应用
 *
 * @param context     上下文
 * @param packageName 包名
 * @param requestCode 请求码
 */
public static void uninstallApk(Activity context,
                                String packageName, int requestCode) {
    Uri packageURI = Uri.parse("package:" + packageName);
    Intent intent = new Intent(
            Intent.ACTION_DELETE,// 动作:删除
            packageURI // 所要删除程序的地址
    );
    context.startActivityForResult(intent, requestCode);
    //ForResult 等待返回值的发送(扔飞镖)
}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:17,代码来源:apitils.java

示例6: uninstallNormal

/**
 * uninstall package normal by system intent
 *
 * @param context
 * @param packageName package name of app
 * @return whether package name is empty
 */
public static boolean uninstallNormal(Context context, String packageName) {
    if (packageName == null || packageName.length() == 0) {
        return false;
    }

    Intent i = new Intent(Intent.ACTION_DELETE, Uri.parse(new StringBuilder(32).append("package:")
            .append(packageName).toString()));
    i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(i);
    return true;
}
 
开发者ID:lizhangqu,项目名称:CorePatch,代码行数:18,代码来源:PackageUtils.java

示例7: uninstallApp

public static void uninstallApp(Context context, String packageName) {
	try {
		Uri packageUri = Uri.fromParts("package", packageName, null);
		if(packageUri != null){
			Intent intentUninstall = new Intent(Intent.ACTION_DELETE, packageUri);
			intentUninstall.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			context.startActivity(intentUninstall);
		}
	} catch (Exception e) { }
}
 
开发者ID:medalionk,项目名称:simple-share-android,代码行数:10,代码来源:PackageManagerUtils.java

示例8: uninstallApk

/**
 * 卸载apk
 *
 * @param context     上下文
 * @param packageName 包名
 */
public static void uninstallApk(Context context, String packageName) {
    Intent intent = new Intent(Intent.ACTION_DELETE);
    Uri packageURI = Uri.parse("package:" + packageName);
    intent.setData(packageURI);
    context.startActivity(intent);
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:12,代码来源:Utils.java

示例9: uninstallApk

/**
 * 卸载软件
 *
 * @param context
 * @param packageName
 */
public static void uninstallApk(Context context, String packageName) {
    if (isPackageExist(context, packageName)) {
        Uri packageURI = Uri.parse("package:" + packageName);
        Intent uninstallIntent = new Intent(Intent.ACTION_DELETE,
                packageURI);
        context.startActivity(uninstallIntent);
    }
}
 
开发者ID:snowwolf10285,项目名称:PicShow-zhaipin,代码行数:14,代码来源:DeviceUtils.java

示例10: uninstallApk

/**
 * 卸载apk
 * 
 * @param context
 * @param packname
 */
public static void uninstallApk(Context context, String packname)
{
    Uri packageURI = Uri.parse("package:" + packname);
    
    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
    
    context.startActivity(uninstallIntent);
}
 
开发者ID:zhuyu1022,项目名称:amap,代码行数:14,代码来源:MIP_SystemUtils.java

示例11: uninstallApk

public static void uninstallApk(Context context, String packageName) {
	Uri uri = Uri.parse("package:" + packageName);
	Intent intent = new Intent(Intent.ACTION_DELETE, uri);
	context.startActivity(intent);
}
 
开发者ID:ebridfighter,项目名称:GongXianSheng,代码行数:5,代码来源:CommonUtils.java

示例12: getRemoveIntent

public Intent getRemoveIntent() {
    Intent intent = new Intent(Intent.ACTION_DELETE, Uri.parse("package:" + packageName));
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return intent;
}
 
开发者ID:SimonMarquis,项目名称:FCM-toolbox,代码行数:5,代码来源:AppPayload.java

示例13: getUninstallAppIntent

/**
 * 获取卸载App的意图
 *
 * @param packageName 包名
 * @return intent
 */
public static Intent getUninstallAppIntent(String packageName) {
    Intent intent = new Intent(Intent.ACTION_DELETE);
    intent.setData(Uri.parse("package:" + packageName));
    return intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
 
开发者ID:tututututututu,项目名称:BaseCore,代码行数:11,代码来源:IntentUtils.java

示例14: getUninstallAppIntent

/**
 * 获取卸载App的意图
 *
 * @param packageName 包名
 * @return intent
 */
public static Intent getUninstallAppIntent(final String packageName) {
    Intent intent = new Intent(Intent.ACTION_DELETE);
    intent.setData(Uri.parse("package:" + packageName));
    return intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
 
开发者ID:Wilshion,项目名称:HeadlineNews,代码行数:11,代码来源:IntentUtils.java

示例15: uninstallApk

/**
 * 卸载应用程序
 *
 * @param pContext
 * @param packageName
 */
public static void uninstallApk(Context pContext, String packageName) {
    Uri packageURI = Uri.parse("package:" + packageName);
    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
    pContext.startActivity(uninstallIntent);
}
 
开发者ID:zeng3234,项目名称:GrowingProject,代码行数:11,代码来源:ApkUtils.java


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