Search code examples
androidtextview

Android: array of textviews


I am making an app in which I want to change the text of textviews from an array of strings. For that I need to make the array of textviews.How to do that?? Can anyone help me over this


Solution

  • You can create TextViews like this:

    int textViewCount = 10;
    
    TextView[] textViewArray = new TextView[textViewCount];
    
    for(int i = 0; i < textViewCount; i++) {
       textViewArray[i] = new TextView(this);
    }