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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:48:18+00:00 2026-06-10T05:48:18+00:00

I have a conflict between a ScrollView and a ViewPager . I’m trying to

  • 0

I have a conflict between a ScrollView and a ViewPager.

I’m trying to do something along the lines of

If user clicks ViewPager:
   Disable ScrollView

If user releases ViewPager:
   Enable ScrollView

I’ve already got the disable/enable code working, but I can’t get the click/release code working.

I’ve tried using OnTouch, as so..

pager.setOnTouchListener(new OnTouchListener() {

    public boolean onTouch(View v, MotionEvent event) {

        if (event.getAction() == MotionEvent.ACTION_DOWN){
            scroller.setScrollingEnabled(false);
        }

        if (event.getAction() == MotionEvent.ACTION_UP){
            scroller.setScrollingEnabled(true);
        }

        return true;
    }
});

..but this seems to disable the ViewPager from scrolling left and right. Am I using it wrong?

Is there any other alternative to detect presses and releases? Also I’m trying to get it to work on Android 2.1 and higher, so OnDrag doesn’t seem compatible.

  • 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-10T05:48:19+00:00Added an answer on June 10, 2026 at 5:48 am

    Description of the return value for OnTouch()-method to the OnTouchListener interface:

    True if the listener has consumed the event, false otherwise.

    OnTouchListener documentation

    Try to return true only for Action of type ACTION_DOWN or ACTION_UP, false otherwise.

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

Sidebar

Related Questions

I'm having an issue trying to fix a conflict between both libraries and have
I have a line of code that causes a conflict between an image slider
I have a namespace conflict between two referenced assemblies: i.e., I'm referencing Foo.A.Foo and
I think I have a conflict between my knowledge on SQL Server and MySQL.
Solution : https://github.com/alexgibson/tap.js I have a conflict between 'touchend' and 'touchmove' events on the
I would like to have some advices because I've got conflict between clients sending
I'm trying to understand this conflict between My loadingbarscript that hides my content until
I have several Jquery libraries and I keep getting conflicts between one or the
When I do a 'git pull', I have conflict with the head commit. So
I have a a jquery conflict which I cannot resolve mainly down the the

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.