標籤:android launcher 源碼
Android4.4上的Launcher3源碼:http://download.csdn.net/detail/deng0zhaotai/8281391
修改後能在Eclipse上調試的Android4.4 Launcher3代碼:http://download.csdn.net/detail/deng0zhaotai/8284961
可以下載兩個工程進行對比就知道有哪些地方修改過的,需要修改的地方
1、刪除兩個檔案src/com/android/launcher3/LauncherBackupAgentHelper.java、 src/com/android/launcher3/LauncherBackupHelper.java是由於缺少com.google的包,還有可能會報import android.support.v4.view.accessibility.AccessibilityEventCompat;這個錯,缺少v4包,需要建立一個libs目錄匯入v4包,在網上搜下就能搜到
2、修改AndroidManifest.xml檔案
添加
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="19"/>
如下
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.launcher3" > <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="19"/>
添加<category android:name="android.intent.category.LAUNCHER" />如下
<activity android:name="com.android.launcher3.Launcher" android:clearTaskOnLaunch="true" android:launchMode="singleTask" android:screenOrientation="nosensor" android:stateNotNeeded="true" android:theme="@style/Theme" android:windowSoftInputMode="adjustPan" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.MONKEY" /> </intent-filter> </activity>
3、修改src/com/android/launcher3/LauncherProvider.java
private void sendNotify(Uri uri) { String notify = uri.getQueryParameter(PARAMETER_NOTIFY); if (notify == null || "true".equals(notify)) { getContext().getContentResolver().notifyChange(uri, null); } // always notify the backup agent //LauncherBackupAgentHelper.dataChanged(getContext()); }修改後的就能在Eclipse上進行調試了,安裝後可以看到右上方有一個launcher3的表徵圖,這就是我們的launcher3
進入launcher3
下面就可以對Launcher3進行調試了
修改Launcher3源碼在ADT(Eclipse)上調試