I can't override the onSwipe() method. The error is "The method onSwipe(int) of type Adds must override or implement a supertype method". Can anyone tell me what I did wrong?. I want to navigate between activities using swipe gesture. Is there any other way to do it? If so please explain. Do I have to import any more packages?
package com.mahavega.qcdemo;
import com.mahavega.qcdemo.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
public class Adds extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ads);
TextView tv1 = (TextView) findViewById(R.id.textView1);
tv1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(new Intent(Adds.this, Ads2.class));
}
});
ImageView im1 = (ImageView) findViewById(R.id.imageView1);
im1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(new Intent(Adds.this, Real.class));
}
});
}
@Override
public void onSwipe(int direction) {
Intent intent = new Intent();
switch (direction) {
case SimpleGestureFilter.SWIPE_RIGHT:
intent.setClass(this, Ads2.class);
break;
case SimpleGestureFilter.SWIPE_LEFT:
intent.setClass(this, Ads3.class);
break;
}
startActivity(intent);
}
}