Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.app.Activity;
import android.content.Intent;
import android.support.annotation.NonNull;
import static android.os.Build.VERSION;
import static android.os.Build.VERSION_CODES;

public class Main {
    public static void restart(final @NonNull Activity activity) {
        if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) {
            activity.recreate();
        } else {
            final Intent intent = activity.getIntent();
            activity.finish();
            activity.startActivity(intent);
        }
    }
}