修改Launcher3源碼在ADT(Eclipse)上調試

來源:互聯網
上載者:User

標籤: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)上調試

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.