I need to handle layout for notch devices. I know in Ios. I can handle it using safe area in Ios. But in android is there any way to achieve this ?
You need DisplayCutout object for this In yours Activity class (in onCreate()):
WindowManager.LayoutParams lp = this.getWindow().getAttributes();
lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
WindowInsets windowInsets = this.getWindow().getDecorView().getRootView().getRootWindowInsets();
DisplayCutout displayCutout = windowInsets.getDisplayCutout();
int bottom = displayCutout.getSafeInsetBottom()
more about this class you can find here: https://developer.android.com/guide/topics/display-cutout and here: https://blog.felgo.com/app-dev-tips-for-devices-with-edge-to-edge-screens-2020