Reputation: 8129
i have a screen which is showing some information about version.there is no controll in the screen.i want to finish this activity when i tap on the screen.can anyone help me plz...
Upvotes: 1
Views: 1318
Reputation: 40401
Make your activity implement OnTouchListener:
public class MyActivity extends Activity implements OnTouchListener{
// All your code goes here
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
this.finish();
return false;
}
}
Upvotes: 7
Reputation: 19220
You could override your activity's onTouchEvent
method to finish it:
@Override
public boolean onTouchEvent(MotionEvent event)
{
this.finish();
return true;
}
Upvotes: 4
Reputation: 3357
Override onTouchEvent in your activity.
@Override
public boolean onTouchEvent (MotionEvent e) {
this.finish();
return false;
}
Upvotes: 1