android - Activity Start slowly -


recently met strange problem,i start activity service,but if follow steps :

  1. enter app
  2. press home key go launcher
  3. then trigger service start activity

after above steps,the activity starts more normal way.because add log in activity's oncreate method.

normal way same above,except pressing home key.

please me solve it.thanks.

you can run service , activity in different processes. moving logging service doesn't bind ui. use process attribute service in androidmanifest.xml

here's snippit docs:

the name of process service run. normally, components of application run in default process created application. has same name application package. element's process attribute can set different default components. component can override default own process attribute, allowing spread application across multiple processes.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -