unInstall Apk - Android android.content.pm

Android examples for android.content.pm:Apk Uninstall

Description

unInstall Apk

Demo Code

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);
    context.startActivity(uninstallIntent);
  }/*  w w  w. j  a  va2 s  .c o m*/

}

Related Tutorials