title: No interface method getMaximumWindowMetrics()Landroid/view/WindowMetrics; in class Landroid/view/WindowManager; or its super classes
body: <pre><code>Fatal Exception: java.lang.NoSuchMethodError: No interface method getMaximumWindowMetrics()Landroid/view/WindowMetrics; in class Landroid/view/WindowManager; or its super classes (declaration of 'android.view.WindowManager' appears in /system/framework/framework.jar!classes2.dex)
         at com.rovedashcam.android.view.rover2.activity.LocalVideoPlayActivityR2.onConfigurationChanged(LocalVideoPlayActivityR2.java:580)
         at android.app.ActivityThread.performActivityConfigurationChanged(ActivityThread.java:5326)
         at android.app.ActivityThread.performConfigurationChangedForActivity(ActivityThread.java:5175)
         at android.app.ActivityThread.performConfigurationChangedForActivity(ActivityThread.java:5153)
         at android.app.ActivityThread.handleActivityConfigurationChanged(ActivityThread.java:5582)
         at android.app.servertransaction.ActivityConfigurationChangeItem.execute(ActivityConfigurationChangeItem.java:43)
         at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
         at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1950)
         at android.os.Handler.dispatchMessage(Handler.java:106)
         at android.os.Looper.loop(Looper.java:214)
         at android.app.ActivityThread.main(ActivityThread.java:7073)
         at java.lang.reflect.Method.invoke(Method.java)
         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
  </code></pre>
  <p>This crash is coming when i change orientation Landscape to PORTRAIT or PORTRAIT to Landscape to adjust full view in landscape and some fix view in PORTRAIT  below is my code</p>
  <pre><code>RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) playerView.getLayoutParams();
                  params.width = params.MATCH_PARENT;
                  WindowMetrics windowMetrics = getWindowManager().getMaximumWindowMetrics();
                  Rect bounds = windowMetrics.getBounds();
                  int widthPixels = bounds.width();
                  //int heightPixels = bounds.height();
                  int heightPixels =(widthPixels*57)/100;
                  params.height=heightPixels;
                  Log.i(&quot;TAG&quot;, &quot;onConfigurationChanged: &quot;+widthPixels);
                  // params.height = (int) (200 * getApplicationContext().getResources().getDisplayMetrics().density);
                  playerView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIT);
  </code></pre>
  <p>crash is coming at this line  WindowMetrics windowMetrics = getWindowManager().getMaximumWindowMetrics(); as per crash report can any one  please help me how to fix this crash .</p>
  <p>i am using min sdk =19, targetsdk = 30 and compile sdk 30 please help me what and how i will fix this crash .</p>