Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import android.os.Build;

import android.view.ContextThemeWrapper;

public class Main {
    public static Context getDialogContext(Context context) {
        return new ContextThemeWrapper(context, getDialogTheme());
    }

    public static int getDialogTheme() {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
            return android.R.style.Theme_Dialog;
        } else {
            return android.R.style.Theme_Holo_Light_Dialog;
        }
    }
}