Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.app.Activity;

import android.content.Intent;

public class Main {

    public static boolean openApp(Activity activity, String action) {
        try {

            Intent intent = new Intent();
            intent.setAction(action);
            activity.startActivity(intent);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
}