androidでホーム画面にショートカットを作りたいができないです。
http://hyoromo.hatenablog.com/entry/20100501/1272666318
を参考にしました。
初心者なので何が間違っているのか見当もつきません。
わかる方どうかご教授下さい。
public class MyAndroidAppActivity extends Activity {
/** Called when the activity is first created. */
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// ショートカット作成 Intent shortcutIntent = new Intent(getApplicationContext(), MyAndroidAppActivity.class); // 作成したショートカットを設定するIntent。ここでショートカット名とアイコンも設定。 Intent intent = new Intent(); intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, R.drawable.ic_launcher); intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "hogehoge"); // ショートカット設定 setResult(RESULT_OK, intent); }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。