get Screen Width via Resources - Android android.app

Android examples for android.app:Screen

Description

get Screen Width via Resources

Demo Code

import android.content.res.Resources;

public class Main{


    public static int getScreenWidth() {
        return Resources.getSystem().getDisplayMetrics().widthPixels;
    }//from www  . ja va  2 s.  c  om

}

Related Tutorials