title: close view after touch android
body: <p>I've got a Activty which is displayed after a info-button is pressed. Now I want to close/ destroy the activty, when the user touches the screen, so that the user can get back to the main-activty again, without pressing the back-button of the device. How does the code look like.</p>
  
  <p>I tried this, but it has no effect:</p>
  
  <pre><code>if(onTouchEvent(null)){
          finish();
  }
  </code></pre>
  
  <p>Thanks.</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>This is the whole code I have:</p>
  
  <pre><code>public class InfoDialog extends Activity{
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.info_dialog); }
  </code></pre>
  
  <p>I use this Class just to show a short Information about the App with in the android-style of Theme.Dialog 
   However, I want to add one function, to destroy/ close this activty, when the touchscreen is pressed, so that there is no need to press the back-button.</p>