android:process用法
1.作用
android:process将组件在新进程中运行.
2.应用范围
可以出现在<application> <activity>, <service>, <receiver>, and<provider>,在<application> 中是所有组件的默认值,它们都在新进程中运行.
<activity
android:name=".NewProcessAty"
android:label="@string/title_activity_new_process_aty"
android:process=":ProcessName">
</activity>
3.android:process的值
它的值是个字符串.在<application> <activity>, <service>, <receiver>, and<provider>中基本相同.新进程的名字.以":"开头.
android:process在<application> 标签语法介绍中的描述
android:processThe name of a process where all components of the application should run. Each component can override this default by setting its own process attribute.
By default, Android creates a process for an application when the first of its components needs to run. All components then run in that process. The name of the default process matches the package name set by the <manifest> element.
By setting this attribute to a process name that's shared with another application, you can arrange for components of both applications to run in the same process — but only if the two applications also share a user ID and be signed with the same certificate.
If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when it's needed. If the process name begins with a lowercase character, a global process of that name is created. A global process can be shared with other applications, reducing resource usage.
android:process在<activity>标签语法介绍中的描述
android:processThe name of the process in which the activity should run. Normally, all components of an application run in a default process name created for the application and you do not need to use this attribute. But if necessary, you can override the default process name with this attribute, allowing you to spread your app components across multiple processes.
If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when it's needed and the activity runs in that process. If the process name begins with a lowercase character, the activity will run in a global process of that name, provided that it has permission to do so. This allows components in different applications to share a process, reducing resource usage.
The <application> element's process attribute can set a different default process name for all components.
android:process在<provider>标签语法介绍中的描述
android:processThe name of the process in which the content provider should run. Normally, all components of an application run in the default process created for the application. It has the same name as the application package. The <application> element's process attribute can set a different default for all components. But each component can override the default with its own processattribute, allowing you to spread your application across multiple processes.
If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when it's needed and the activity runs in that process. If the process name begins with a lowercase character, the activity will run in a global process of that name, provided that it has permission to do so. This allows components in different applications to share a process, reducing resource usage.
android:process在<receiver>标签语法介绍中的描述
android:processThe name of the process in which the broadcast receiver should run. Normally, all components of an application run in the default process created for the application. It has the same name as the application package. The <application> element's process attribute can set a different default for all components. But each component can override the default with its own processattribute, allowing you to spread your application across multiple processes.
If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when it's needed and the broadcast receiver runs in that process. If the process name begins with a lowercase character, the receiver will run in a global process of that name, provided that it has permission to do so. This allows components in different applications to share a process, reducing resource usage.
android:process在<service>标签语法介绍中的描述
android:processThe name of the process where the service is to run. Normally, all components of an application run in the default process created for the application. It has the same name as the application package. The <application> element's process attribute can set a different default for all components. But component can override the default with its own process attribute, allowing you to spread your application across multiple processes.
If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when it's needed and the service runs in that process. If the process name begins with a lowercase character, the service will run in a global process of that name, provided that it has permission to do so. This allows components in different applications to share a process, reducing resource usage.
android:process用法的更多相关文章
- Android Meun 用法
Android Meun 用法 点击菜单实体键弹出菜单:如下图 main_activity.xml <?xml version="1.0" encoding="ut ...
- Android ViewPager 用法
Android ViewPager 用法 场景:一般第一次打开应用程序时,程序会有一个提示页来给展现应用程序都有哪些功能:或者程序更新时,又更新哪些新特性,都可以使用ViewPager Demo 描述 ...
- Android:关于声明文件中android:process属性说明
笔者在学习Android Service组件的过程中碰到了一个问题,就是在Android应用的声明文件Manifest.xml中有时候会对相关的服务标签设置一个android:process=&quo ...
- Android Intent 用法全面总结
[代码全屏查看]-Android Intent 用法全面总结 // [1].[代码] 调用拨号程序 跳至 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] / ...
- Android GLSurfaceView用法详解(二)
输入如何处理 若是开发一个交互型的应用(如游戏),通常需要子类化 GLSurfaceView,由此可以获取输入事件.下面有个例子: java代码: package eoe.ClearTes ...
- Android开发之android:process=":remote"
由于每个应用程序都运行在自己的进程空间,并且可以从应用程序UI运行另一个服务进程,而且经常会在不同的进程间传递对象.在Android平台,一个进程通常不能访问另一个进程的内存空间,所以要想对话,需要将 ...
- [Java][Android][Process] 暴力的服务能够解决一切,暴力的方式运行命令行语句
不管是在Java或者Android中运行命令行语句殊途同归都是创建一个子进程运行调用可运行文件运行命令.类似于Windows中的CMD一样. 此时你有两种方式运行:ProcessBuilder与Run ...
- android:process为耗资源操作指定一个新进程
当有一些耗费内存比较多的操作时,可以通过android:process指定一个新的进程.保证程序运行. 例如: 一个后台长期运行的service: <service android:name=& ...
- apk,task,android:process与android:sharedUserId的区别
apk一般占一个dalvik,一个进程,一个task.通过设置也可以多个进程,占多个task. task是一个activity的栈,其中"可能"含有来自多个App的activity ...
随机推荐
- 2014ACM/ICPC亚洲区域赛牡丹江站现场赛-I ( ZOJ 3827 ) Information Entropy
Information Entropy Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Information ...
- Swift基础一(代码)
import Foundation println("Hello, World!") var string1 = "Hello BeiJing" //定义一个变 ...
- iOS 用xib自定义View
网上有很多关于实现用xib自定义View,那我为什么还要写呢?第一,我用他们的方法都没有实现.第二,用xib遇到了很多问题,想分享给大家. 用xib自定义View:FHCustomView ...
- seajs载入流程图
近期读seajs源代码,整理出了主要逻辑的流程图(注意:是逻辑示意图).感兴趣的朋友能够看看,欢迎批评指正~ http://www.gliffy.com/go/publish/image/607216 ...
- 浏览器同部署了https的服务器交互的过程
1 浏览器发起https请求 2 https服务器发送自己的公钥给浏览器 3 浏览器用https服务器发送过来的公钥加密一个用于双方通信的的对称密码 4 https服务器用自己的私钥解密,获取对称密码 ...
- 函数 devm_kzalloc()【转】
本文转载自:http://blog.csdn.net/jgw2008/article/details/52691568 函数 devm_kzalloc() 和kzalloc()一样都是内核内存分配函数 ...
- YTU 2952: A代码填充--谁挡住了我
2952: A代码填充--谁挡住了我 时间限制: 1 Sec 内存限制: 128 MB 提交: 135 解决: 38 题目描述 n个人前后站成一列,对于队列中的任意一个人,如果排在他前面的人的身高 ...
- 信息检索导论的课件——http://home.ustc.edu.cn/~zhufengx/ir/pdf/
http://home.ustc.edu.cn/~zhufengx/ir/pdf/ 中科大
- HDU4642博弈好题
链接:http://acm.hdu.edu.cn/ 两个人进行翻棋游戏,若a[n][m]为1,则不管先手就可以翻a[n][m]使其为0,这样不管后手翻什么都会使得a[n][m]为1,先手总是有棋可翻: ...
- DoDataExchange的作用
void CDlgSelectCS::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Te ...