2010-09-08 87 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

相關問題