samedi 24 novembre 2018

Android / String resources for options

I making a random textview and I have a problem. How can I put strings resources from xml to String options[]:

String options[] = {"abc","def","ghi",}

    Random rand = new Random();
    final int random = rand.nextInt(3);

    textfacts.setText(options[random]);

I want to use these strings in Strings options:

<string name="1">abc</string>
<string name="2">abc</string>
<string name="3">abc</string>




Aucun commentaire:

Enregistrer un commentaire