title: Android 10 Activity onCreate Crash
body: <p>The splash activity of my app works well on all devices except on an Android 10 device that I have just recently updated. </p>
  
  <p><strong>Here is my code:</strong></p>
  
  <pre><code>public class SplashScreen extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      if(FirebaseAuth.getInstance().getUid() != null)
        startActivity(new Intent(this, HomeActivity.class));
      else
        startActivity(new Intent(this, LoginActivity.class));
  
      finish();
    }
  
  }
  </code></pre>
  
  <p>I have also tried navigating directly to <code>HomeActiviy</code> or <code>LoginActivity</code> but still  crashes when I try to run on an Android 10 device</p>
  
  <pre><code>Error occurs when calling super.onCreate(savedInstanceState)
  
  2020-01-17 13:58:25.527 23561-23561/? E/AndroidRuntime: FATAL EXCEPTION: main
      Process: rickroydaban.projects.android.memorise, PID: 23561
      java.lang.RuntimeException: Unable to start activity ComponentInfo{rickroydaban.projects.android.memorise/rickroydaban.android.memorise.ui.SplashScreen}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.ReportFragment.setProcessListener(androidx.lifecycle.ReportFragment$ActivityInitializationListener)' on a null object reference
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3448)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3595)
          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
          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:2147)
          at android.os.Handler.dispatchMessage(Handler.java:107)
          at android.os.Looper.loop(Looper.java:237)
          at android.app.ActivityThread.main(ActivityThread.java:7811)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
       Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.ReportFragment.setProcessListener(androidx.lifecycle.ReportFragment$ActivityInitializationListener)' on a null object reference
          at androidx.lifecycle.ProcessLifecycleOwner$3.onActivityCreated(ProcessLifecycleOwner.java:162)
          at android.app.Application.dispatchActivityCreated(Application.java:392)
          at android.app.Activity.dispatchActivityCreated(Activity.java:1232)
          at android.app.Activity.onCreate(Activity.java:1513)
          at androidx.core.app.ComponentActivity.onCreate(ComponentActivity.java:81)
          at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:149)
          at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:313)
          at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:106)
          at rickroydaban.android.memorise.ui.SplashScreen.onCreate(SplashScreen.java:18)
          at android.app.Activity.performCreate(Activity.java:7955)
          at android.app.Activity.performCreate(Activity.java:7944)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3423)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3595) 
          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
          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:2147) 
          at android.os.Handler.dispatchMessage(Handler.java:107) 
          at android.os.Looper.loop(Looper.java:237) 
          at android.app.ActivityThread.main(ActivityThread.java:7811) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076) 
  </code></pre>
  
  <p>Has anyone able to fix <a href="https://i.stack.imgur.com/XHlUG.png" rel="nofollow noreferrer">this</a> issue?</p>