本文实例讲述了android编程实现为程序创建快捷方式的方法。分享给大家供大家参考,具体如下:
/**
* 为程序创建桌面快捷方式
*/
private void addShortcut(){
Intent shortcut = new Intent(com.android.launcher.action.INSTALL_SHORTCUT);
//快捷方式的名称
shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name));
shortcut.putExtra(duplicate, false)