Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.List;

import android.app.ActivityManager;

public class Main {

    static void destroySelfProcess(ActivityManager activityManger) {
        List<ActivityManager.RunningAppProcessInfo> appProcessList = activityManger.getRunningAppProcesses();
        for (ActivityManager.RunningAppProcessInfo appProcessInfo : appProcessList) {
            int pid = appProcessInfo.pid;
            String processName = appProcessInfo.processName;
            if (-1 != processName.indexOf("com.wxlh.sptas")) {
                android.os.Process.killProcess(pid);
            }
        }
    }
}