title: Android Studio OnClick just working once
body: <p>when I try to push the button it only works once...</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  TextView txt;
  Button btn;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      txt = (TextView) findViewById(R.id.mytext);
      btn = (Button) findViewById(R.id.button1);
  
      btn.setOnClickListener(new View.OnClickListener(){
          @Override
          public void onClick(View v){
  
              txt.setText("" +1);
  
          }
      } );
  </code></pre>
  
  <p>how can I solve it? Thanks a lot</p>