6

ピック アクティビティに問題があります。次のポップアップが表示されます。

ここに画像の説明を入力

テキストの色は白で、背景も同じです。これは私が使用するコードです:

    Bundle bundle = new Bundle();
    ArrayList<String> shortcutNames = new ArrayList<String>();
    shortcutNames.add(getString(R.string.group_applications));
    bundle.putStringArrayList(Intent.EXTRA_SHORTCUT_NAME, shortcutNames);

    ArrayList<ShortcutIconResource> shortcutIcons = new ArrayList<ShortcutIconResource>();
    shortcutIcons.add(ShortcutIconResource.fromContext(this,
            R.drawable.ic_launcher));
    bundle.putParcelableArrayList(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, shortcutIcons);

    Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);
    pickIntent.putExtra(Intent.EXTRA_INTENT, new Intent(Intent.ACTION_CREATE_SHORTCUT));
    pickIntent.putExtra(Intent.EXTRA_TITLE, getText(R.string.app_name));
    pickIntent.putExtras(bundle);

    startActivityForResult(pickIntent, 1);
4

1 に答える 1

0

I finally got the solution:

You need to use

Intent pickIntent = new Intent(Intent.ACTION_CHOOSER);

The rest is still the same. This code will give you the Holo dialog.

于 2013-02-18T17:55:09.310 に答える