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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:44:56+00:00 2026-06-06T10:44:56+00:00

As said in the title, I have a scrollview that should be listening for

  • 0

As said in the title, I have a scrollview that should be listening for longclicks, but isn’t catching any. Nothing happens when I hold the scrollview- no logs, no haptic feedback, & no dialog.

Thanks in advance!

JAVA:

...
ScrollView text_sv = (ScrollView) findViewById(R.id.text_sv);
    text_sv.setOnLongClickListener(new OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {

            MMMLogs.i("click", "long-click recognized");

            AlertDialog.Builder builder = new AlertDialog.Builder(_this);

            builder
            .setTitle(name)
            .setMessage(DHMenuStorage.notification)
            .setCancelable(false)
            .setNegativeButton("Close", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();
                }
            });
            AlertDialog alert = builder.create();
            alert.show();

            return true;
        }

    });
...

XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="5dp" >

<ScrollView
    android:id="@+id/text_sv"
    android:layout_width="match_parent"
    android:layout_height="75dp"
    android:hapticFeedbackEnabled="true"
    android:clickable="true"
    android:longClickable="true" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/name"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@color/Gray"
            android:focusable="false"
            android:gravity="center"
            android:padding="4dp"
            android:text="-- Dining Hall Name --"
            android:textColor="@color/Black"
            android:textSize="28dp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/note"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@color/Gray"
            android:focusable="false"
            android:gravity="center"
            android:padding="4dp"
            android:text="-- Special note here --"
            android:textColor="@color/Black"
            android:textSize="14dp"
            android:textStyle="normal" />
    </LinearLayout>
</ScrollView>

<TabHost
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        android:padding="5dp" >

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="5dp" />
    </LinearLayout>
</TabHost>

  • 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-06T10:44:59+00:00Added an answer on June 6, 2026 at 10:44 am

    Well I never identified the exact source of my problem, but I suspect it is some sort of conflict with the listeners that the scrollview requires for its own scrolling.

    I worked around this problem by setting the exact same listener on the linearlayout instead of the scrollview. Simple. Hope it helps!

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

Sidebar

Related Questions

I have a link that opens up JSON data in the browser, but unfortunately
Just like the title said. For example: I have a class like this: class
I have some trouble with a spreadsheet: as said in the title, I put
As it says in the title I want to have a button/link that when
Like I said in the topic title, there's some translations missing on PROD (but
Hope the title is not that confusing - honestly said I had no idea
As the title said: I would like to find all elements that are on
as i said in my title am learning about Ajax and i have a
As title said, I have C program complied and created a binary in 64-bit
as the title said i would like to create a button that says available

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.