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进行调试了