Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {

    public static int getMinWidth(Activity act) {
        return Math.min(getDisplayWidth(act), getDisplayHeight(act));
    }

    public static int getDisplayWidth(Activity act) {
        return act.getWindowManager().getDefaultDisplay().getWidth();
    }

    public static int getDisplayHeight(Activity act) {
        return act.getWindowManager().getDefaultDisplay().getHeight();
    }
}