title: java.lang.IllegalStateException in playstore crashes (only on Android 8.0)
body: <p>i am getting crash reports at google play console.
  i can see it happens with only on Android 8.0 only.. not even any other single devices.</p>
  
  <p>The log is:</p>
  
  <pre><code>java.lang.RuntimeException: 
    at android.app.ActivityThread.performLaunchActivity 
    (ActivityThread.java:2858)
    at android.app.ActivityThread.handleLaunchActivity 
    (ActivityThread.java:2933)
    at android.app.ActivityThread.-wrap11 (Unknown Source)
    at android.app.ActivityThread$H.handleMessage 
    (ActivityThread.java:1612)
    at android.os.Handler.dispatchMessage (Handler.java:105)
    at android.os.Looper.loop (Looper.java:164)
    at android.app.ActivityThread.main (ActivityThread.java:6710)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run 
    (Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:770)
  
    Caused by: java.lang.IllegalStateException: 
    at android.app.Activity.onCreate (Activity.java:986)
    at com.shravanvinu.stockscreener.TrendActivity.onCreate 
    (TrendActivity.java:44)
    at android.app.Activity.performCreate (Activity.java:6982)
    at android.app.Instrumentation.callActivityOnCreate 
    (Instrumentation.java:1214)
    at android.app.ActivityThread.performLaunchActivity 
    (ActivityThread.java:2811)
  </code></pre>
  
  <p>I dont see it wen i run in debug or release mode from android studio. 
  but i can see lot of such crashes everyday on play store reports.</p>
  
  <p>To be specific. this is a custom Dialog activity called from in my main activity. </p>
  
  <p>App level gradle file</p>
  
  <pre><code>    buildscript {
        repositories {
      maven { url 'https://plugins.gradle.org/m2/' }
      }
      dependencies {
      classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:        [0.11.0, 0.99.99]'
         }
      }
      apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
  
      repositories {
      maven { url 'https://maven.google.com' }
      maven { url 'https://jitpack.io' }
      }
  
     apply plugin: 'com.android.application'
  
     android {
      compileSdkVersion 29
      defaultConfig {
      applicationId "com.shravanvinu.stockscreener"
      manifestPlaceholders = [
              onesignal_app_id               : 'b3223944-9679-4fed-a192-         3f316321a794',
              // Project number pulled from dashboard, local value is 
      ignored.
              onesignal_google_project_number: 'REMOTE'
      ]
      minSdkVersion 16
      targetSdkVersion 29
      versionCode 18
      versionName "4"
      testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
      vectorDrawables.useSupportLibrary = true
      }
      buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 
     'proguard-rules.pro'
          }
      }
      }
  
      dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'androidx.appcompat:appcompat:1.0.2'
      implementation 'com.google.android.material:material:1.0.0'
  
      implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
      implementation 'com.google.android.gms:play-services-ads:18.0.0'
  
      implementation files('libs/coollection.jar')
      implementation 'com.github.anastr:speedviewlib:1.2.0'
      implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
      implementation 'com.google.firebase:firebase-core:17.0.0'
      implementation 'com.anjlab.android.iab.v3:library:1.0.44'
      implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'
      }
      apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>i was using app compact, now change to android x in this release.</p>