---
title: "定制Android的Home"
author: "秦朝古月"
date: "2011-01-21T00:32:42Z"
tags: []
categories: ["移动开发"]
slug: "android-home"
draft: false
lastmod: "2011-01-21T00:32:42Z"
id: 890463
url: "https://ilgnep.iteye.com/blog/890463"
---

接到任务去调查如何定制Android的Home，在网上查了一下资料。本来以为很难的，但是居然只是简单的修改manifest.xml文件。参考<http://blog.csdn.net/sijiangong/archive/2009/08/12/4440037.aspx>，只要把 android.intent.category.LAUNCHER 改为 android.intent.category.HOME，居然就可以把程序变成Home。


```xml
<application android:icon="@drawable/icon" android:label="@string/app_name">
       <activity android:name=".MyHome" android:label="@string/app_name">
            <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.HOME" />
                 <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
       </activity>
</application>
```


试着把HelloWorld改了一下，在启动模拟器后，单机Home键，就可以得到如下的效果。
![](http://dl.iteye.com/upload/attachment/401770/8076b23f-cd39-3e83-935c-c1081739c506.jpg)

不过如果真的定制，还需要在自己的Home应用可以调用别的应用。

如果想要真正控制用户的界面，需要采用下边链接的方法。
<http://hi.baidu.com/lvqiyong/blog/item/a5410e890ed459c1fc1f10ff.html>
这个需要自己编译Android，制作img。下次再研究。我还没有学会编译呢。 :cry: