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 8094279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:45:05+00:00 2026-06-05T20:45:05+00:00

I have an android application. I have four screens and each screen contains a

  • 0

I have an android application. I have four screens and each screen contains a listview.. My requirement is that when a user flips horizontally then it should change the ui screen and when the user flips vertically it should scroll through the list.My code is

public boolean dispatchTouchEvent(MotionEvent event)
 {
     System.out.println("22");
       int eventaction=event.getAction();

         switch(eventaction) 
        {
          case (MotionEvent.ACTION_MOVE):
              System.out.println("move");
          a=1;
          break;

              case MotionEvent.ACTION_UP:
                  System.out.println("up");
              if(a==1)
              {
                  view1.setAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_left));
                  view1.showNext();
              }
              a=0;
                  break;

          default:
          break;
        }

        return super.dispatchTouchEvent(event);
}
  • 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-06-05T20:45:06+00:00Added an answer on June 5, 2026 at 8:45 pm

    I had a similar issue where the children were eating up all the scroll events. I ended up overiding the onInterceptTouchEvent in the parent to detect if it was a horizontal or vertical swipe and acting accordingly. You would want something like this

    @Override
    public boolean onInterceptTouchEvent (MotionEvent ev){
        if(horizontalSwipe(ev)){
            return true;
        }
        else
            return false;
    
    }
    

    where you have some function that determines from your history if the new motion event constitutes a horizontal motion event.

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

Sidebar

Related Questions

I have an android application which contains four modules(I mean four apk's).Each module has
I have an android application that displays a toast every hour and then every
I have android application with ListView, where each row has own refresh button. Refreshing
We have an Android application that requires the user to enter an answer to
I have an Android application that allows the user to connect to his Facebook
I have an Android Application that has four activities. None is very large and
I have an Android application that contains two Activities . Activity A has a
I have a Android application that requires a splash screen. I have a simple
I have an Android application that connects to Facebook to request authorization of an
I have an Android application that uses the Android database to create tables and

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.