Android Studio 2.0 - pause/white screen on App first run

后端 未结 2 1134
耶瑟儿~
耶瑟儿~ 2020-11-28 08:15

Since upgrading to Android Studio 2.0 (stable) I\'ve noticed an issue that wasn\'t there in the previous version of Android Studio 1.5 I had installed.

I\'m working

相关标签:
2条回答
  • 2020-11-28 08:48

    Check image for reference Turn off Instant Run in Settings. File>Settings>Build,Deployment>Instant Run Deselect all options shown there.

    Now white screen problem is solved.

    In android studio 2.0,My APK size was 16 MB while using Instant Run Without using Instant Run it became 27 MB. While in 1.5 .. the size was 27 MB.

    Instant Run is the culprit.

    • White screen Issue/ Instant Run is only for Debug builds .. Issue will not affect release builds.
    0 讨论(0)
  • 2020-11-28 08:53

    No need at all, If you try to deselect all option in Settings. File > Settings > Build, Deployment > Instant Run, your app will get into large size build on the device. (On your device goto Settings-->Application-->See your app in a big size than normal. In this case to avoid white screen when running your app, in AndroidMenifest.xml, at first activity, add:

    "android:theme="@android:style/Theme.Translucent.NoTitleBar"

    For example:

           <activity
               android:name=".WelcomeScreen"
               android:label="@string/app_name"
               android:theme="@android:style/Theme.Translucent.NoTitleBar" >
               <intent-filter>
                   <action android:name="android.intent.action.MAIN" />
                   <category android:name="android.intent.category.LAUNCHER" />
               </intent-filter>
           </activity>
           <activity android:name=".SplashActivity" />
    

    In this example, WelcomeScreen is my First start Activity.

    Goodluck to you!

    0 讨论(0)
提交回复
热议问题