當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。