0

I have a simple app, with nothing too fancy going on (essentially just a tab pager and a recycler view). However when I start up my app from the launcher I get an all white screen for ~3 seconds before my ui shows on screen. I have not had this issue with other apps before. Now I am wondering, how can I look into why it is taking so long?

Does Android Studio have anything to help see why my app takes so long to load?

The delay seems to be worse if starting from completely dead. If the program is in recent tasks the white screen only displays for about a quarter of a second or so.

MrSalmon
  • 89
  • 1
  • 5
  • are you debugging on your phone( `usb debugging`) or in the `emulator – Kasun Siyambalapitiya Jun 15 '16 at 17:18
  • Is Instant Run enabled in debug build? If so try disabling, uninstalling and reinstalling apk .. http://stackoverflow.com/q/36575229/4252352 – Mark Jun 15 '16 at 17:22
  • @KasunSiyambalapitiya I am running on a physical device – MrSalmon Jun 15 '16 at 17:24
  • @MarkKeen Thanks. This may be it. I am not plugged into android studio or using instant run when I am trying this now, but maybe I just need a relase apk to make it go away – MrSalmon Jun 15 '16 at 17:26
  • If it is indeed to do with instant run, disabling it, uninstalling, and then rebuilding/reinstalling the apk will work .. If it still persists after this then its something else - having the device unplugged doesn't make a difference with instant run (the built apk starts up slower regardless). – Mark Jun 15 '16 at 17:29

1 Answers1

1

Android Studio provides a couple of tools to help you track down performances. You'll be able to find out if you allocate too many objects on the main thread, or if your XML hierarchy is too complicated etc.

mbmc
  • 5,024
  • 5
  • 25
  • 53
  • Thanks for the link. Although it does not say too much. It says that the tools exist, but not much more than that. I will do some searching and see what I can find. – MrSalmon Jun 15 '16 at 17:27
  • You need to drill down in each categories: [java heap](https://developer.android.com/studio/profile/am-hprof.html), [overdraw](https://developer.android.com/studio/profile/dev-options-overdraw.html) etc – mbmc Jun 15 '16 at 17:48