title: Create dynamic view of some data
body: <p>How to create dynamic view of some data getting from database like in below picture. In below pic, first line consist of 1 view, second line consist of 2 view similarly 3rd line has 1 view and fourth line 2 view. like in below pic.<a href="https://i.stack.imgur.com/Sm5tW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sm5tW.jpg" alt="enter image description here"></a></p>
  
  <p>I know well that how to create a layout using java like this code, </p>
  
  <pre><code>final int N = 10; // total number of textviews to add
  
  final TextView[] myTextViews = new TextView[N]; // create an empty array;
  
  for (int i = 0; i &lt; N; i++) {
      // create a new textview
      final TextView rowTextView = new TextView(this);
  
      // set some properties of rowTextView or something
      rowTextView.setText("This is row #" + i);
  
      // add the textview to the linearlayout
      myLinearLayout.addView(rowTextView);
  
      // save a reference to the textview for later
      myTextViews[i] = rowTextView;
  }
  </code></pre>
  
  <p>but i want to know how each line different to each other.</p>