title: Android How to change data of Textview by clicking on button
body: <p>First of all, the app looks like this.</p>
  
  <p><img src="https://i.stack.imgur.com/Yh8jA.png" alt="App design"></p>
  
  <p>How to make - if I click on Add, on its column the textview is updated with value + 1?</p>
  
  <p>I'm creating TextView and Button in a Loop;</p>
  
  <pre><code>for(int i = 0;i &lt; playercountint; i++)
  {
  LinearLayout layout = new LinearLayout(this);
              layout.setOrientation(LinearLayout.VERTICAL);
              layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT,(100/playercountint)));
              layout.setGravity(Gravity.CENTER_HORIZONTAL);
  TextView tt = new TextView(this);
              tt.setText("0");
              tt.setTextSize(14);
              tt.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
              tt.setGravity(Gravity.CENTER_HORIZONTAL);
  
  
              Button btadd = new Button(this);
              btadd.setText("Add");
              btadd.setId(2);
  
  
              btadd.setOnClickListener(new View.OnClickListener() {
                   public void onClick(View v) {
                       ????? what here?
                   }
               });
  }
  </code></pre>
  
  <p>What should be written in onClick function , so only TextView value which is in buttons column is changed.</p>
  
  <p>There is one outer LinearLayout which is horizontally oriented, and those which are created within a loop is vertical Linear Layouts.</p>
  
  <p>Maybe i should create a template for 1 loop iteration?</p>