Android挑选活动文字颜色

时间:2012-11-24 09:34:53

标签: android android-intent android-activity shortcuts

我的挑选活动有问题,我有这个弹出窗口:

enter image description here

文字颜色为白色和背景。 这是我使用的代码:

    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);

1 个答案:

答案 0 :(得分:0)

我终于得到了解决方案:

您需要使用

Intent pickIntent = new Intent(Intent.ACTION_CHOOSER);

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