Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2108385
  • 博文数量: 413
  • 博客积分: 10926
  • 博客等级: 上将
  • 技术积分: 3862
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-09 18:14
文章分类

全部博文(413)

文章存档

2015年(5)

2014年(1)

2013年(5)

2012年(6)

2011年(138)

2010年(85)

2009年(42)

2008年(46)

2007年(26)

2006年(59)

分类: Java

2011-02-16 18:24:42

  1. Exit process
    • 1st way
      System.exit(-1);  //-1 can be replaced with other value
    • 2nd way
      Process.killProcess(Process.myProcess());
  2. How does application component launch in process/thread
    When an application component starts and the application does not have any other components running, the Android system starts a new Linux process for the application with a single thread of execution. By default, all components of the same application run in the same process and thread (called the "main" thread). If an application component starts and there already exists a process for that application, then the component is started within that process and uses the same thread of execution.

    However, you can arrange for different components in your application to run in separate processes, and you can create additional threads for any process. 

    The manifest entry for each type of component element—, , , and —supports an android:process attribute that can specify a process in which that component should run. You can set this attribute so that each component runs in its own process or so that some components share a process while others do not. You can also set android:process so that components of different applications run in the same process—provided that the applications share the same Linux user ID and are signed with the same certificates.

    The element also supports an android:process attribute, to set a default value that applies to all components.

  3. xxx
阅读(889) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~