using getWindowManager() inside BroadcastReceiver

Simple code you only need context

        DisplayMetrics metrics = new DisplayMetrics();
        WindowManager windowManager = (WindowManager) context
                .getSystemService(Context.WINDOW_SERVICE);
        windowManager.getDefaultDisplay().getMetrics(metrics);

More info go to documentation

Or you can use this one

context.getResources().getDisplayMetrics()

but read documentation

Return the current display metrics that are in effect for this
resource object. The returned object should be treated as read-only.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)