Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5937939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:36:48+00:00 2026-05-22T15:36:48+00:00

Basically, I have a ViewFlipper that flips when I swipe my finger on it.

  • 0

Basically, I have a ViewFlipper that flips when I swipe my finger on it. This is the code I have in my Activity:

public boolean onTouchEvent(MotionEvent touchevent) {
    switch (touchevent.getAction()) {
    case MotionEvent.ACTION_DOWN: {
        oldTouchValue = touchevent.getX();
        break;
    }
    case MotionEvent.ACTION_UP: {
        float currentX = touchevent.getX();
        if (oldTouchValue > currentX) {
            ViewHelper.swapFlipperNext(vf);//helper method for flipping
            setMyProgress();//helper method to set my progress bar
        }
        if (oldTouchValue < currentX) {
            ViewHelper.swapFlipperPrevious(vf);
            setMyProgress();
        }
        break;
    }
    }
    return false;
}

It works perfectly except for one thing, I can flip it if my finger is on a non-view part of the screen. But if my figure swipe on some views(Since I have textviews and webviews in each page of the flipper too), the onTouchEvent doesn’t get activated, so the ViewFlipper doesn’t get switched, how do I fix that? Thanks a lot

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:36:48+00:00Added an answer on May 22, 2026 at 3:36 pm

    try setting the focusable attribute on your textviews and webviews to false. basically what i think is happening is these are consuming the touch event.

    EDIT: if this doesn’t work, try the following

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        if (gestureDetector != null) {
            gestureDetector.onTouchEvent(ev);
        }
        return super.dispatchTouchEvent(ev);
    }
    

    where gestureDetector is a member variable.

    see from here: EditText not capturing ViewFlipper flings?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically have a lot of poorly designed code to do something that, I'm
I basically have something like this: class CGlToolBase { public: CGlToolBase(void) { } virtual
I have a ViewFlipper implementation that needs to be improved. This ViewFlipper has three
I basically have this piece of code. char (* text)[1][80]; text = calloc(2821522,80); The
I basically have something like this: void Foo(Type ty) { var result = serializer.Deserialize<ty>(inputContent);
I basically have three tables, posts, images and postimages (this simply contains the ids
I basically have 7 select statements that I need to have the results output
basically have two questions. 1. Is there a c++ library that would do full
I basically have the same problem in this questions: Flash Video still playing in
I basically have a div on my site that always has the same stuff.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.