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.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

public class Main {
    public static void showDialog(DialogFragment dialog, FragmentManager fragmentManager, String tag,
            boolean allowStateLoss) {
        if (allowStateLoss) {
            final FragmentTransaction transaction = fragmentManager.beginTransaction();
            transaction.add(dialog, tag);
            transaction.commitAllowingStateLoss();
        } else {
            dialog.show(fragmentManager, tag);
        }

    }
}