1.配置创建桌面快捷图标的权限
2.在splashActivity中的oncreate方法中调用
--------------------------------------------------------------------------------------
<!--快捷图标的权限 -->
<uses-permission android:name= "com.android.launcher.permission.INSTALL_SHORTCUT" />
----------------------------------------------------------------------------------------
/**
* 安装快捷图标
*/
private void installShortCut()
{
Intent intent = new Intent();
intent.setAction( "com.android.launcher.action.INSTALL_SHORTCUT" );
intent.putExtra(Intent. EXTRA_SHORTCUT_NAME, "手机卫士");
intent.putExtra(Intent. EXTRA_SHORTCUT_ICON,
BitmapFactory.decodeResource(getResources(), R.drawable. logo));
intent.putExtra( "duplicate", false); //不重复创建应用桌面快捷图标
Intent homeIntent = new Intent();
//注意 桌面快捷图标的意图 必须是 隐式意图
homeIntent.setAction( "com.itheima.home");
homeIntent.addCategory(Intent. CATEGORY_DEFAULT);
intent.putExtra(Intent. EXTRA_SHORTCUT_INTENT,
homeIntent); //指定点击桌面图标进入的activity
sendBroadcast(intent); //通过广播事件创建桌面快捷图标
}