title: App takes too long to start-up
body: <p>I have and android app which takes >=5 seconds to show up after it's icon is clicked.</p>
  
  <p>As soon as I click the icon, I get the black screen with name of the app in status bar. After 5+ seconds, the home screen appears.</p>
  
  <p>I referred <a href="https://stackoverflow.com/questions/4706251/how-to-improve-the-startup-time-of-an-android-app">this post</a> on SO which and I got following result from stack trace</p>
  
  <pre><code>16:13:14.915: I/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=packageName/.SelectType }
  16:13:14.954: I/SurfaceFlinger(59): 
  16:13:14.954: I/SurfaceFlinger(59): SurfaceFlinger::createSurface() : layer-&gt;mIdentity=176, LayerName= Starting packageName
  16:13:14.954: I/SurfaceFlinger(59): SurfaceFlinger::createSurface() : layer-&gt;clientIndex=2, surfaceHandle-&gt;mToken=0x2
  16:13:16.026: D/AnrParser(184): Waiting kernel log . . .
  16:13:16.614: D/dalvikvm(6890): GC_FOR_MALLOC freed 12274 objects / 785016 bytes in 135ms
  16:13:17.784: D/dalvikvm(133): GC_EXTERNAL_ALLOC freed 415 objects / 21624 bytes in 1285ms
  16:13:17.914: D/dalvikvm(6890): GC_FOR_MALLOC freed 5762 objects / 339024 bytes in 90ms
  16:13:18.174: D/AnrParser(184): Waiting kernel log . . .
  16:13:18.344: E/keystore(6966): chdir: /data/misc/keystore: Permission denied
  16:13:19.693: D/dalvikvm(6890): GC_FOR_MALLOC freed 5994 objects / 372624 bytes in 93ms
  16:13:20.173: D/AnrParser(184): Waiting kernel log . . .
  16:13:22.173: D/AnrParser(184): Waiting kernel log . . .
  16:13:22.743: I/SurfaceFlinger(59): 
  16:13:22.743: I/SurfaceFlinger(59): SurfaceFlinger::createSurface() : layer-&gt;mIdentity=177, LayerName= packageName/packageName.SelectType
  16:13:22.743: I/SurfaceFlinger(59): SurfaceFlinger::createSurface() : layer-&gt;clientIndex=0, surfaceHandle-&gt;mToken=0x0
  16:13:22.983: D/dalvikvm(6890): GC_FOR_MALLOC freed 21467 objects / 1097728 bytes in 119ms
  16:13:23.403: E/keystore(6973): chdir: /data/misc/keystore: Permission denied
  16:13:24.173: D/AnrParser(184): Waiting kernel log . . .
  16:13:24.923: W/ActivityManager(59): Launch timeout has expired, giving up wake lock!
  16:13:25.264: W/ActivityManager(59): Activity idle timeout for HistoryRecord{47f56388 packageName/.SelectType}
  16:13:25.403: I/ActivityManager(59): Displayed activity packageName/.SelectType: 10206 ms (total 10206 ms)
  </code></pre>
  
  <p>As you can see in above log, 1st statement is <code>16:13:14.915: I/ActivityManager(59): Starting activity</code> and last one is <code>16:13:25.403: I/ActivityManager(59): Displayed activity</code>.</p>
  
  <p>So there is a gap of approx. 10 to 11 seconds.</p>
  
  <p>Any help appreciated.</p>