Note that there are some explanatory texts on larger screens.

plurals
  1. POonSwipe(int direction) not working
    primarykey
    data
    text
    <p>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?</p> <pre><code>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); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload