我在android中做了一个应用程序,我在那个和ontouch事件中做了两个活动,我想要一个滑动效果,因为我的代码如下但它不起作用,我的代码如下,请帮助我:
效果.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;
}
}