您的位置:首页 > 移动开发 > Android开发

android in practice_Threads and concurrency

2012-12-28 11:29 471 查看
you can run services in separate processes, but that isn’t a requirement. In fact, unless you specify a process ID explicitly, they won’t.

one golden rule about user interfaces is to always remain responsive.

When launching your application, Android will spawn a single system process running a single thread of execution.this thread is called the main application thread,

main user interface thread, or UI thread.


Writing code like this may freeze your application—Android can’t continue drawing your application’s user interface until the download completes because both download and UI code run in the same thread.

Any non-blocking or fast operation is fine to execute on the main application thread that’s running when an application starts. Anything else should be executed on a different thread.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: