Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.annotation.TargetApi;
import android.app.Activity;

import android.os.Build;

import android.support.v4.app.FragmentActivity;

public class Main {
    private static final String DIALOG_TAG = "applover_dialog";

    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    public static boolean isDialogShown(Activity activity) {
        if (activity instanceof FragmentActivity) {
            return ((FragmentActivity) activity).getSupportFragmentManager().findFragmentByTag(DIALOG_TAG) != null;
        } else {
            return activity.getFragmentManager().findFragmentByTag(DIALOG_TAG) != null;
        }
    }
}