Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.util.DisplayMetrics;

import android.view.WindowManager;

public class Main {

    public static String getDisplay(WindowManager windowManager) {
        DisplayMetrics metrics = new DisplayMetrics();
        windowManager.getDefaultDisplay().getMetrics(metrics);
        int ScreenWidth = metrics.widthPixels;
        int ScreenHeight = metrics.heightPixels;
        String displayInfo = ScreenWidth + "," + ScreenHeight;
        return displayInfo;
    }
}