title: how to display output in textview using android?
body: <p>i am newbie in  android and i m not getting how to produce this output:
  Discipline name:1
  {  complete for loop code execute from 0 to 9
  }</p>
  
  <p>then it will come outside and will update textview text:ie 
  Discipline name:2 
  and will enter inside For Loop
  {
  complete for loop code execute from 0 to 9
  }</p>
  
  <p>here is the java code:</p>
  
  <pre><code>public class SummaryDetailActivity extends Activity
  {  TableLayout summaryDetailDisciplineTableLayout;
     LayoutInflater mInflater;
  
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.summarydetail_view);
                   mInflater = getLayoutInflater();
  summaryDetailDisciplineTableLayout = (TableLayout)findViewById(R.id.summaryDetail_disciplinetable);
  </code></pre>
  
  <p>//PLEASE SEE THESE LINE OF CODE: </p>
  
  <pre><code>    for(int i=0;i&lt;2;i++)
    {
    TextView disciplineTextView = (TextView)findViewById(R.id.summaryDetail_disciplinetext);
    disciplineTextView.setText("discipline name: "+i);
   for(int j=0;j&lt;10;j++)
  {TableRow disciplineRow = (TableRow) mInflater.inflate(R.layout.summarydetailrow_view,null);
  TextView disciplineDeviceLabel = (TextView) disciplineRow.findViewById(R.id.summaryDetail_info1);
  TextView disciplineQuantityLabel = (TextView)disciplineRow.findViewById(R.id.summaryDetail_hypen);
   TextView disciplineLocationLabel = (TextView) disciplineRow.findViewById(R.id.summaryDetail_info2);
    disciplineDeviceLabel.setText("device no." + j);
  disciplineQuantityLabel.setText("quantity No." + j);
    disciplineLocationLabel.setText("Location No." + j);
  disciplineRow.setId(j);
    summaryDetailDisciplineTableLayout.addView(disciplineRow);
  }
  
  }
  }
  }
  </code></pre>
  
  <p>this code is producing this output:
  <img src="https://i.stack.imgur.com/jr40M.png" alt="Snapshots of code"></p>