I have made an application in android,I made two activites in that and ontouch event i want a swipe effect in that my code is as below but its not working,My code is as below,Please help me for it:
Effect.java
package com.Effects.pageeffects;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.FeatureInfo;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.Button;
public class EffectsActivity extends Activity implements OnTouchListener{
Button b1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_effects);
}
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
startActivity(new Intent(EffectsActivity.this, Page2Activity.class));
// Set the transition -> method available from Android 2.0 and beyond
overridePendingTransition(R.anim.left_to_rigth, R.anim.rigth_to_left);
return true;
}
}