2012-11-24 10 views
6

、私はこのポップアップを持っている:Androidのpickアクティビティのテキストの色

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

私はAndroid 4.2で同じ問題があります。自分でリストを実装すると思います。 PackageManager.queryIntentActivities()から項目を取得できます Androidの実装については、こちらをご覧ください:https://github.com/android/platform_packages_apps_settings/blob/master/src/com/android/settings/ActivityPicker.java – Alex

+0

はい、まだ4.2.1で壊れた。 – soundmaven

+0

ありがとうございます!ダイアログを実装します – jaumard

答えて

0

私は最終的に解決策だ:

あなたは残りの部分はまだ同じである

Intent pickIntent = new Intent(Intent.ACTION_CHOOSER); 

を使用する必要があります。 このコードはHoloダイアログを表示します。

+0

実際に開始する前に、選択したアクティビティで何かを行う必要がある場合、それは役立ちません。 'Intent.FLAG_GRANT_READ_URI_PERMISSION'の意図は、アクティビティがライフサイクルを超えてURIに保持されている場合(Eメールなどの添付ファイルの場合など)に問題を引き起こす可能性があります。また、Jelly Beanの前には保存されたURIとにかくエクストラで)。 – JAB

関連する問題