Androidプログラミングはプログラムのためにショートカットを作成する方法を実現します。


この例は、プログラムのための高速化方式を作成するための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); //       
//     Activity          :  
//com.everest.video.VideoPlayer
//  : ComponentName            (.),              
ComponentName comp = new ComponentName(this.getPackageName(), "."+this.getLocalClassName());
shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(Intent.ACTION_MAIN).setComponent(comp));
//       
ShortcutIconResource iconRes = Intent.ShortcutIconResource.fromContext(this, R.drawable.icon);
shortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconRes);
sendBroadcast(shortcut);
}

ここで述べたように、皆さんのAndroidプログラムの設計に役に立ちます。