Java tutorial
//package com.java2s; //License from project: Apache License import android.app.Activity; import android.view.Display; public class Main { /** * Get current {@link Activity} screen height. * * @param activity Object of {@link Activity} * @return Screen height, failed will return 0. */ public final static int getScreenHeight(Activity activity) { if (null == activity) { return 0; } try { Display d = activity.getWindowManager().getDefaultDisplay(); return d.getHeight(); } catch (Exception e) { e.printStackTrace(); return 0; } } }