Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class Main {
    /**
     * Propose user to uninstall the given application
     *
     * @param context
     * @param packageName package of the application to uninstall
     */
    public static void uinstallApplication(final Context context, final String packageName) {
        final Intent intent = new Intent(Intent.ACTION_DELETE, Uri.fromParts("package", packageName, null));
        context.startActivity(intent);
    }
}