2010-09-08 88 views

回答

40

编写自己的主屏应用程序是可能的。它被称为启动器。

您可以通过Git获取默认Android启动器的源代码。

项目网址是:

https://android.googlesource.com/platform/packages/apps/Launcher2.git

你可以得到这样的源代码:

git clone https://android.googlesource.com/platform/packages/apps/Launcher2.git 

这将创建一个名为的launcher2你的目录。现在你可以破解并创建自定义启动器。

如果您在使用Git时需要帮助,请检查Git的documentation section

+18

不要忘了看一看以及ADW启动的源代码:http://code.google。 com/p/adw-launcher-android/ – benvd 2010-09-08 10:41:35

+0

+1 ADW Launcher也是一个很好的例子。 – 2010-09-08 10:45:28

+0

有趣的downvote,照顾解释? – 2012-10-08 14:06:12

28

的特定意图,使您的活动的主屏幕是:

<activity....> 
<!-- Put this filter inside the activity to make it the Home screen --> 
    <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> 
+1

非常简单。这是我需要知道的。 – Ton 2014-02-27 13:11:11

+0

我试过你的答案,但控制台说没有发现发现活动.. – 2014-06-11 16:15:57

+0

是的..太简单了:) – androidDev 2014-08-20 17:14:22

相关问题