Font einer Liste in einem AlertDialog ändern

  • 1 Antworten
  • Letztes Antwortdatum
R

RobNeck

Ambitioniertes Mitglied
3
Nabend!

Ich habe schon ewig gegoogelt, ohne bisher wirklich eine Antwot auf meine Frage zu finden.

In meienr MainActivity habe ich einen Button, der wenn er geklickt wird, einen AlertDialog mit einer Liste von Optionen aufruft. Genauer gesagt handet es sich dabei um einen solchen MultiChoiceItems Dialog:

Code:
public Dialog onCreateDialog(Bundle savedInstanceState) {
    mSelectedItems = new ArrayList();  // Where we track the selected items
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    // Set the dialog title
    builder.setTitle(R.string.pick_toppings)
    // Specify the list array, the items to be selected by default (null for none),
    // and the listener through which to receive callbacks when items are selected
           .setMultiChoiceItems(R.array.toppings, null,
                      new DialogInterface.OnMultiChoiceClickListener() {
               @Override
               public void onClick(DialogInterface dialog, int which,
                       boolean isChecked) {
                   if (isChecked) {
                       // If the user checked the item, add it to the selected items
                       mSelectedItems.add(which);
                   } else if (mSelectedItems.contains(which)) {
                       // Else, if the item is already in the array, remove it 
                       mSelectedItems.remove(Integer.valueOf(which));
                   }
               }
           })

Da ich in meienr App einen custom font verwende, würde ich natürlich gerne auch die Schrift der Listenelemente anpassen. Hat jemand eine Idee, wie das funktionieren könnte?
 
Custom Dialog

Gesendet von meinem Nexus 4 mit Tapatalk 4
 
Zurück
Oben Unten