This Function return the Android Device Display Height. - Android User Interface

Android examples for User Interface:Screen Size

Description

This Function return the Android Device Display Height.

Demo Code


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

public class Main {
    /**/* w ww .  j av a2 s .  co m*/
     * This Function return the Android Device Display Height.
     * 
     * See below for @params.
     */

    public static int getMyDispalyHight(Context ctx) {

        int Hight = ((Activity) ctx).getWindowManager().getDefaultDisplay()
                .getHeight();
        return Hight;
    }
}

Related Tutorials