start Activity Safe - Android Activity

Android examples for Activity:Activity Start

Description

start Activity Safe

Demo Code


//package com.java2s;
import android.content.Context;
import android.content.Intent;

public class Main {
    public static void startActivitySafe(Context context, Intent intent) {
        try {/*from  w  ww.j  a v a 2  s  .c  o  m*/
            context.startActivity(intent);
        } catch (Exception e) {
            // ignore
            e.printStackTrace();
        }
    }
}

Related Tutorials