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 {
    public static void startActivityNoHistory(Activity activity, Class classActivity) {
        Intent intent = new Intent();
        intent.setClass(activity, classActivity);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        activity.startActivity(intent);
    }

    public static void startActivity(Activity activity, Class classActivity) {
        Intent intent = new Intent();
        intent.setClass(activity, classActivity);
        activity.startActivity(intent);
    }

    public static void startActivity(Intent intent, Activity activity, Class classActivity) {
        intent.setClass(activity, classActivity);
        activity.startActivity(intent);
    }
}