UnInstall Apk Intent - Android android.content.pm

Android examples for android.content.pm:Apk Uninstall

Description

UnInstall Apk Intent

Demo Code

import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;

public class Main{

    public static void UnInstallApk(Context context, String pkName) {
        Uri packageURI = Uri.parse(pkName);
        Intent uninstallIntent = new Intent(Intent.ACTION_DELETE,
                packageURI);/*from   w  w w.  j a v a2s.co  m*/
        context.startActivity(uninstallIntent);
    }

}

Related Tutorials