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 {
    private static int deviceHeight = 0;

    @SuppressWarnings("deprecation")
    public static int getDeviceHeight(Activity activity) {
        if (deviceHeight == 0) {
            deviceHeight = activity.getWindowManager().getDefaultDisplay().getHeight();
        }
        return deviceHeight;
    }
}