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

  • Home
  • SEARCH
  • 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 8948779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:04:59+00:00 2026-06-15T13:04:59+00:00

I have an ImageView inside a ScrollView . The ImageView is clickable and opens

  • 0

I have an ImageView inside a ScrollView. The ImageView is clickable and opens up a new Activity.

Whenever I scroll through my ScrollView first touching the image (But not releasing my finger yet) and try to scroll it fires my onTouch() or onClick() method (I have tried with both…)

Here is my code:

btnAdd.setOnTouchListener(new OnTouchListener() {
       @Override
       public boolean onTouch(View v, MotionEvent event) {
           Intent intent = new Intent(Intent.ACTION_EDIT);
           startActivity(intent);
           return true;
       }
});

As I said I also tried with onClick()…

What am I doing wrong?

  • 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-15T13:05:00+00:00Added an answer on June 15, 2026 at 1:05 pm

    When the OnTouchListener is triggered it listen for multiple actions (Action Down, Action Up, etc) and executes them all so you should specify exactly when you want to start the new activity (in your case on Action Up). So try to use this:

     btnAdd.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent event) {
                if (event.getAction() == MotionEvent.ACTION_UP){
                    Intent intent = new Intent(Intent.ACTION_EDIT);
                    startActivity(intent);
                }
                return true;
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have imageView inside a relative layout. And when i create the activity i
I have a layout with two ImageView inside. Each image has a fixed aspect
I Have a UIScrollview with a UIImageView inside where I scroll from an image
I'm trying to have my Activity update an ImageView whenever a boolean value changes
I have a problem with my ScrollView. It has an ImageView inside it. The
I have a scroll view. Inside scroll view, I have image view. I want
I have 2 scrollviews and 1 imageview . now Inside Main scrollview I have
I have a RelativeLayout inside a ScrollView. My RelativeLayout has android:layout_height=match_parent but the view
I have a ListView composed of LinearLayouts. Inside each is an ImageView, TextView and
I have imageView in activity. How I can set position this imageView in my

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.