Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static boolean startApplication(String namespace, String activity) {
        try {
            String cmd = "am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n %s/%s";
            Runtime.getRuntime().exec(String.format(cmd, namespace, activity));
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}