dimanche 23 août 2015

Display a Sequence of Numbers in Android TextView

I'm looking to display a sequence of numbers in a TextView field I created, but only one number is displayed once the method is called. How do I fix it to display all the numbers?

For example:

Display = (TextView) findViewById(R.id.Sequence);
    for(i=0; i<10; i++){
        Numbers[i] = random.nextInt(10)+1;              
        Display.setText(Numbers[i]+" ");        
    }

My guess is that it is displaying all the numbers, but only the last one with a space after it is shown. Anyway, I want all 10 numbers to appear on the same line. How do I go about doing that?




Aucun commentaire:

Enregistrer un commentaire