Android:Android应用中的所有活动都在同一个线程中运行,还是在自己的线程中运行? [英] Android: Are all activities in an Android app run in the same thread or separate threads of their own?

查看:164
本文介绍了Android:Android应用中的所有活动都在同一个线程中运行,还是在自己的线程中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Android应用中的所有活动是在同一个线程中运行还是在自己的单独线程中运行?

I want to know if all activities in an Android app are run in same thread or separate threads of their own?

推荐答案

一个应用程序的所有活动都在同一个主线程上运行,也称为UI线程。
但您可以通过在清单文件的actvity标记中设置进程属性来更改此行为。请参阅 http://developer.android.com/guide/topics/ manifest / activity-element.html#proc

All activities of one application all run on the same "main" thread, also called "UI-thread". But you can change this behaviour by setting a process attribute in the actvity tag in the manifest file. See http://developer.android.com/guide/topics/manifest/activity-element.html#proc

这篇关于Android:Android应用中的所有活动都在同一个线程中运行,还是在自己的线程中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆