uninstall APK file via Intent - Android App

Android examples for App:APK Install and Uninstall

Description

uninstall APK file via Intent

Demo Code


//package com.java2s;

import android.content.Context;
import android.content.Intent;

import android.net.Uri;

public class Main {

    public static void unInstallApk(Context context, String packageName) {
        Uri packageURI = Uri.parse("package:" + packageName);
        Intent uninstallIntent = new Intent(Intent.ACTION_DELETE,
                packageURI);//from   w w w .j  av  a  2  s.co m
        context.startActivity(uninstallIntent);
    }
}

Related Tutorials