修改Launcher3源码在ADT(Eclipse)上调试

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

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值