Reputation: 14465
I am aware of the 'black screen problems' when starting Android L, see for example here:
Cannot create an emulator with Android L (API 20)
We had this problem too, and solved it by activating the 'Use Host GPU' setting. After that, we were able to start up the emulator and debug our app.
The main screen of the app appears to be fine, but as soon as we start another activity, a black screen appears. While the black screen is on screen, we can always go back to the main activity by pressing the (soft / hardware) back button.
To be clear, our app runs fine on KitKat (emulators and devices).
Any idea what could be wrong?
Upvotes: 0
Views: 747
Reputation: 14465
Turns out the reason was that we were calling setContentView(_view);
in onResume()
.
As soon as we moved that call to onCreate()
, everything was working as expected.
Upvotes: 0
Reputation: 1020
When you start another activity, A Black Screen appearance is because of the time that your system is taking to render the next activity on to your emulator's screen with your new version.
Most of the times, it does happen to render the screen/layout/activity results in black screen for longer times and if you can kill all other unused processes and help make the system cache resource free that should result in making things work fine.
I observed this happens with 4.4L emulators but there is NO issue with Kitkat or other version Emulators as the present allocated cache is enough.
As you've also mentioned that your app is working fine with KitKat version Emulator and with 4.4L you are seeing this issue but able to go back/homee without issues..the above might be the reason.
Another solution to this is in yoru HAXM settings, you can allocate more system cache than the existing and try to see if the problem goes. I've done this. Earlier, I've allocated 4GB Cache for Intel HAXM but increated to 6GB now and things look pretty cool as of now :)
Upvotes: 1