@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
    private void registerDisplayListener() {
        final DisplayManager displayManager =
                (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
        final Handler handler = new Handler(Looper.getMainLooper());
        displayManager.registerDisplayListener(mDisplayListener, handler);
    }
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
    private void registerDisplayListener() {
        final DisplayManager displayManager =
                (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
        final Handler handler = new Handler(Looper.getMainLooper());
        displayManager.registerDisplayListener(mDisplayListener, handler);
    }
@requiresapi(api = build.version_codes.jelly_bean_mr1) private void registerdisplaylistener() { final displaymanager displaymanager = (displaymanager) getsystemservice(context.display_service); final handler handler = new handler(looper.getmainlooper()); displaymanager.registerdisplaylistener(mdisplaylistener, handler); }