What is the Alternate for getDefaultDisplay()

Viewed 43

I am getting waring getDefaultDisplay() is deprecated. Need to use Context.getDisplay(). But below R version what we need to use? Please help me on this.

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) {
    display = mContext.getDisplay();
} else {
    ((Activity) mContext).getWindowManager().getDefaultDisplay(); //Deprecated
}
0 Answers
Related