I usually do startActivity() before finish() , since I think that make sure the new screen comes out before the previous one goes blank.
I have a login page to my application. After a successful login, the login activity will disappear and the main action will be completed. It works great in Android 4.
Today I wanted to rewrite it in Material Design. However, I had a big problem. The new Android studio creates empty work with a material design, which, I think, requires a lot of resources. The same process, but I got an error
11-26 18:20:44.450 18397-18397/? I/Choreographer: Skipped 42 frames! The application may be doing too much work on its main thread. 11-26 18:20:44.485 18397-18408/? I/art: Background partial concurrent mark sweep GC freed 2864(191KB) AllocSpace objects, 4(43MB) LOS objects, 13% free, 100MB/116MB, paused 8.056ms total 39.767ms
He said that my applications take up a lot of resources when mainActivity runs in my phone logcat. I have nothing in mainActivity just that this is the default Material Design layout.
I changed the order and now it works without errors on my phone.
hatted Nov 26 '15 at 10:47 2015-11-26 10:47
source share