How to add multiple TextView dynamically to the define LinearLayout in main.xml

You only need to create an array if you need to change the TextViews later. However, if you do need to make an array, then something like this should work.

List<TextView> textList = new ArrayList<TextView>(NUM_OF_TEXTS);
for(int i = 0; i < NUM_OF_TEXTS; i++)
{
   TextView newTV = new TextView(context);
   newTV.setText("New message.");
   newTV.setTextColor(0xFFFF0000);
   /**** Any other text view setup code ****/
   myLinearLayout.addView(newTV);
   textList.add(newTV);
}

If the text is static once created, then you can simply remove any reference to the list in code, and it will still be added to the LinearLayout.

EDIT:

Assuming I understand your question right, you want the layout to be something like this:

Word:
Big
Answer:
42

Word:
Small
Answer:
Tough

Word:
Example
Answer:
Another Answer

In that case, you literally don't have to do much. LinearLayout will put everything in the order that you place it with addView. To update my previous code, this should work:

List<TextView> wordList = new ArrayList<TextView>(NUM_OF_WORDS);
List<TextView> answerList = new ArrayList<TextView>(NUM_OF_ANSWERS);

for(int i = 0; i < NUM_OF_WORDS; i++){
   TextView blankText = new TextView(context);
   TextView wordText = new TextView(context);
   TextView answerText = new TextView(context);
   blankText.setText(" ");
   wordText.setText("Word:");
   answerText.setText("Answer:");

   TextView newWord = new TextView(context);
   newWord.setText(**** some method of getting the word ****);
   TextView newAnswer = new TextView(context);
   newAnswer.setText(**** some method of getting the answer ****);
   /**** Any other text view setup code ****/

   myLinearLayout.addView(wordText);
   myLinearLayout.addView(newWord);
   myLinearLayout.addView(answerText);
   myLinearLayout.addView(newAnswer);
   myLinearLayout.addView(blankText);

   wordList.add(newWord);
   answerList.add(newAnswer);
}

        LinearLayout lila = new LinearLayout(this);
        ArrayList<Button> alb = new ArrayList<Button>();
        int nButton = 10;
        for (int i = 0; i < nButton; i++)
        {
            alb.add(new Button(this));
            lila.addView(alb.get(i));
        }
        //works the same way with TextView
        alb.get(5).setText("myButton");

Maybe this could help.

EDIT : Sorry strictly the same as DeeV.