title: Is it ever safe, to execute getIntent().getExtras() before Activity.super.onCreate()
body: <p>If we turn on &quot;Don't keep activites&quot; and &quot;No background processes&quot; in Developer options, we can produce the following behaviour easily.</p>
  <ul>
  <li><code>Activity.super.onCreate()</code> will trigger <code>Fragment.onCreate()</code></li>
  <li>Activity will only initialize data structure after <code>Activity.super.onCreate()</code></li>
  <li>If <code>Fragment.onCreate()</code> is accessing data structure in Activity, crash will happen as data structure is not being initialized yet.</li>
  </ul>
  <p>This behaviour is described in <a href="https://stackoverflow.com/questions/30297978/why-fragments-oncreate-is-sometimes-called-prior-to-activitys-oncreate">Why Fragment&#39;s onCreate() is sometimes called prior to Activity&#39;s onCreate()?</a></p>
  <p>We just change our code from</p>
  <hr />
  <h2>Accessing Bundle after Activity.super.onCreate</h2>
  <pre><code>public class MyActivity extends AppCompatActivity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          
          final Bundle bundle = this.getIntent().getExtras();
          this.dataStructure = bundle.getParcelable(...);
      }
  }
  </code></pre>
  <p>to</p>
  <hr />
  <h2>Accessing Bundle before Activity.super.onCreate</h2>
  <pre><code>public class MyActivity extends AppCompatActivity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          final Bundle bundle = this.getIntent().getExtras();
          this.dataStructure = bundle.getParcelable(...);
  
          super.onCreate(savedInstanceState);
      }
  }
  </code></pre>
  <hr />
  <p>We have done intensive testing and it works fine.</p>
  <p>However, under Firebase Crashlytics, we saw very minor edge cases, <code>getIntent().getExtras()</code> is returning null sometimes?</p>
  <p>I was wondering, is it caused by the fact that I am accessing <code>getIntent().getExtras()</code> before <code>Activity.super.onCreate()</code>, or that might due to other reasons?</p>