I am a beginner in Android. I created an activity for the first screen, and I need to navigate to the second screen when there is a touch action.
I have this piece of code in the first activity.
public boolean onTouchEvent(MotionEvent event)
{
// TODO Auto-generated method stub
startActivity(new Intent("com.vignesh.omsairam.CLEARSCREEN2"));
return super.onTouchEvent(event);
}
Now, on touch action from the first screen, -> the second screen gets displayed for a second; then, the first screen again gets displayed for a second, and then the second screen gets loaded permanently.
I dont know why the first screen gets loaded unnecessarily.
Is there something else that I should handle in code ?? Pls help !!
Thanks !!!!
Because, Your touch event response on both
ACTION_DOWNandACTION_UPPut this condition on method
onTouchEvent()