1: 在android 清单文件中添加过滤条件
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MONKEY" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</activity>
2: 构建数据库 相关的资料,数据data
iteminfo
package com.kodulf.mylauncher.data; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.os.UserHandle; import android.os.UserManager; import android.util.Log; import java.io.ByteArrayOutputStream; import java.io.IOException; /** * Represents an item in the launcher. */ class ItemInfo { static final int NO_ID = -1; /** Fix 这里需要用的是long */ long id = NO_ID; String title; /** 启动的意图 */ String intent; int screenId = -1; /** application,shortcut,widget */ int itemType = -1; /