get Display Metrics via Activity - Android android.app

Android examples for android.app:Activity Property

Description

get Display Metrics via Activity

Demo Code

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.DisplayMetrics;

public class Main{


    public static DisplayMetrics getDisplayInfo(Activity paramActivity) {
        return paramActivity.getResources().getDisplayMetrics();
    }/* w  w w . j a  va  2 s . c  o m*/

}

Related Tutorials