Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.app.Activity;

import android.content.Intent;

public class Main {
    /**
     * Safely wrapper of {@link Context#startActivityForResult}.
     * 
     * @param context
     * @param intent
     * 
     * @return True means start success, otherwise false.
     */
    public final static boolean startActivityForResultSafely(Activity context, Intent intent, int requestCode) {
        try {
            context.startActivityForResult(intent, requestCode);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
}