title: Textviews not showing up from array and fragment?
body: <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent" android:layout_height="match_parent" 
      android:background="#e3e6e4"
      android:padding="16dp"
      android:paddingTop="30dp"
      android:id="@+id/connections"&gt;
  
      &lt;TextView
          android:layout_width="fill_parent"
          android:layout_height="1dp"
          android:text=" "
          android:background="#007e0e"
          android:id="@+id/textView"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I have a problem. I wrote a for loop to add a textview in the array and then add it to my <code>LinearLayout</code>. All of this is done programmatically. None of this is showing up. There are no syntax or run time errors. However, in my xml i did include a horizontal line. Thats the only thing that shows up.</p>
  
  <pre><code>package com.example.user.navigationdrawer;
  
  import android.app.Fragment;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.view.Gravity;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.EditText;
  import android.widget.LinearLayout;
  import android.widget.TextView;
  
  import org.jsoup.Jsoup;
  import org.jsoup.nodes.Document;
  import org.jsoup.select.Elements;
  
  import java.io.IOException;
  import java.text.SimpleDateFormat;
  import java.util.ArrayList;
  import java.util.Calendar;
  import java.util.Date;
  import java.util.Locale;
  
  
  public class FirstFragment extends Fragment {
  
      View myView;
      static final String url = "https://www.website.org/";
      ArrayList&lt;String&gt;  outPut = new ArrayList&lt;&gt;();
      LinearLayout diaryLayout;
  
      final int N = 3; // total number of textviews to add
  
      TextView[] myTextViews; // create an empty array;
      TextView rowTextView;
  
      //ArrayList&lt;String&gt; h4 = new ArrayList&lt;&gt;();
  
      @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          myView = inflater.inflate(R.layout.first_layout, container, false);
          diaryLayout = (LinearLayout) myView.findViewById(R.id.connections);
          new Ann().execute();
          return myView;
      }
  
          private class Ann extends AsyncTask&lt;Void, Void, Void&gt; {
  
          @Override
          protected Void doInBackground(Void... params) {
              try {
                  // Connect to the web site
                  Document document = Jsoup.connect(url).get();
  
                  // Get the html document title
                  Elements notificationWall = document.select("div[class=flex_column av_one_fifth  flex_column_table_cell av-equal-height-column av-align-top av-zero-column-padding   " +
                      "avia-builder-el-11  el_after_av_one_fifth  el_before_av_one_third]"); //Connect to website.The Notification wall.
  
                  Elements sectionTag = notificationWall.select("section"); //Get section tag.
                  Elements contentTitles = sectionTag.select("h4"); // Get H4
                  Elements bodyText = sectionTag.select("p"); //Get P
                  Elements linkTag = sectionTag.select("a"); //Get links
                  Elements images = sectionTag.select("img"); // get image.
  
                  for (int section = 0; section &lt; sectionTag.size(); section++) {
                      outPut.add(sectionTag.get(section).text());
                  }
              } catch (IOException e) {
                  e.printStackTrace();
              } 
  
              return null;
          }
  
          @Override
          protected void onPostExecute(Void result) {
          // Set title into TextView
          //here.
  
              //The problem is here!!!
  
              myTextViews = new TextView[N];
  
              for (int i = 0; i &lt; N; i++) {
                  // create a new textview
                  myTextViews[i] = new TextView(diaryLayout.getContext());
  
                  // set some properties of rowTextView or something
                  myTextViews[i].setText("This is row #" + i );
  
  
                  myTextViews[i].setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
                      LinearLayout.LayoutParams.WRAP_CONTENT));
                  myTextViews[i].setTextSize(14);
                  myTextViews[i].setPadding(100,1000,100,100);
                  myTextViews[i].setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
  
                  // add the textview to the linearlayout
                  diaryLayout.addView(myTextViews[i]);
              }
  
          }
      }
  }
  </code></pre>