How to Handle ConfigChanges in Library or Module Java Android?

24 views Asked by At

I add ConfigChange in Manifest on My Aplication Package:

android:configChanges="screenLayout|uiMode|orientation|screenSize"

But when rotation, Width and Height Size detect just first runtime not changed in My Module or Library Package. So layout for My BottomSheetDialog not change mode when device is rotated or orientation changed?

WindowManager windowManager = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics displayMetrics = new DisplayMetrics();
windowManager.getDefaultDisplay().getMetrics(displayMetrics);
System.out.println(displayMetrics);

Result Width and Height the same first startup or launching, not change when device is rotated or orientation changed. Any body have solution for this?

0

There are 0 answers