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

我终于得到了解决方案:

你需要使用

Intent pickIntent = new Intent(Intent.ACTION_CHOOSER);

其余的还是一样的。此代码将为您提供 Holo 对话框。

于 2013-02-18T17:55:09.310 回答