title: Android - Close activity on button click
body: <p>I have a Bus timetable app with a lot of activity (around 120). It is working smoothly, but after opening several activities, it gets slower. So I have buttons that opens an other activity. I want to kill the former activity after the other is opened. How can I make it? Thanks in advance.</p>
  
  <p>My button click action:</p>
  
  <pre><code>addListenerOnButton();
  }
  
  
  public void addListenerOnButton() {
  
  final Context context = this;
  
  button101 = (Button) findViewById(R.id.button101);
  
  button101.setOnClickListener(new OnClickListener() {
  
      @Override
      public void onClick(View arg0) {
  
          Intent intent = new Intent(context, B10oda.class);
          startActivity(intent);   
      }
  });
  </code></pre>