title: Attempt to invoke virtual method 'internal.policy.DecorView.getWindowInsetsController()' on a null object reference
body: <p>My application is giving an Error in the opening file. But this bug is only api 30 channel. This is the fault:
  Attempt to invoke virtual method 'android.view.WindowInsetsController com.android.internal.policy.DecorView.getWindowInsetsController()' on a null object reference</p>
  <p>When I put the application in the Goggle Robo test, it gives the following error. But this error occurs only in the api 30s. It works correctly in other apes. I would be glad if you could help. Thank you.</p>
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mobilprogramlar.bilmecebahcesi/com.mobilprogramlar.bilmecebahcesi.AcilisEkrani}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.WindowInsetsController com.android.internal.policy.DecorView.getWindowInsetsController()' on a null object reference
           FATAL EXCEPTION: main
      Process: com.mobilprogramlar.bilmecebahcesi, PID: 13816
      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mobilprogramlar.bilmecebahcesi/com.mobilprogramlar.bilmecebahcesi.AcilisEkrani}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.WindowInsetsController com.android.internal.policy.DecorView.getWindowInsetsController()' on a null object reference
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
          at android.os.Handler.dispatchMessage(Handler.java:106)
          at android.os.Looper.loop(Looper.java:223)
          at android.app.ActivityThread.main(ActivityThread.java:7656)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
      Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.WindowInsetsController com.android.internal.policy.DecorView.getWindowInsetsController()' on a null object reference
          at com.android.internal.policy.PhoneWindow.getInsetsController(PhoneWindow.java:3880)
          at com.mobilprogramlar.bilmecebahcesi.AcilisEkrani.onCreate(AcilisEkrani.java:18)
          at android.app.Activity.performCreate(Activity.java:8000)
          at android.app.Activity.performCreate(Activity.java:7984)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
          ... 11 more
  
  
  
  java.util.ConcurrentModificationException
       FATAL EXCEPTION: main
  Process: com.google.android.googlequicksearchbox:search, PID: 9903
  java.util.ConcurrentModificationException
      at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:966)
      at java.util.LinkedList$ListItr.next(LinkedList.java:888)
      at com.google.android.apps.gsa.shared.util.debug.a.g.a(SourceFile:30)
      at com.google.android.apps.gsa.shared.util.debug.a.g.a(SourceFile:135)
      at com.google.android.apps.gsa.contentprovider.initializer.c.dump(SourceFile:6)
      at android.app.ActivityThread.handleDumpProvider(ActivityThread.java:4307)
      at android.app.ActivityThread.access$2400(ActivityThread.java:237)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2013)
      at android.os.Handler.dispatchMessage(Handler.java:106)
      at android.os.Looper.loop(Looper.java:223)
      at android.app.ActivityThread.main(ActivityThread.java:7656)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
  </code></pre>
  <p>The opening file is the file with the error.</p>
  <pre><code>public class AcilisEkrani extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //requestWindowFeature(Window.FEATURE_NO_TITLE);  
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.R) {
              **final WindowInsetsController insetsController = getWindow().getInsetsController();**
              if (insetsController != null) {
                  insetsController.hide(WindowInsets.Type.statusBars());
              }
          } else {
              getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
          }
          setContentView(R.layout.acilisekrani);
  
          // Thread 
          Thread timer = new Thread() {
              @Override
              public void run() {
                  try {
                      sleep(1000);    
                  } catch (InterruptedException e) {
                      e.printStackTrace();   
                      Log.i(&quot;tago&quot;,&quot;Zamanlayıcı Çalışmadı&quot;);
                  } finally {
                      Intent i = new Intent(AcilisEkrani.this,UygulamaUrunlerimiz.class);
                      startActivity(i);
                      AcilisEkrani.this.finish();  
                      finish();
                  }
              }
          };
          // Thread 
          timer.start();  
      }
  
      @Override
      protected void onPause() {
          super.onPause();
          finish();       
      }
  }
  </code></pre>