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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:38:31+00:00 2026-06-03T00:38:31+00:00

I have a seekbar in a listview, it is disabled to stop the user

  • 0

I have a seekbar in a listview, it is disabled to stop the user from changing the value whilst scrolling the list. I wish to enable it if the list item is long clicked, allow the user to change it and then disable it again.

Any suggestions.

I seem unable to access the seekbar from the activity as it is setup inside the ArrayAdapter to display a value from the database

I am able to fire a both a click event and a long click event for the list item, as the seekbar is currently disabled.

  • 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-03T00:38:32+00:00Added an answer on June 3, 2026 at 12:38 am

    Solution

    In the ArrayAdapter I set both enabled and focusable to false and added the SeekBar listener, setting the attributes to false allowed me to use the list item onItemClicked listener. Inside the onItemCLickListener I retreived the seekbar, set the attributes to true, this meant it could be slid up or down. I then disabled it after the adjustment had been made. code below

    ArrayAdapter Snippet

    this code is inside the creation of the list item, in which the seekbar is housed

        seekBar.setClickable(false);
        seekBar.setFocusable(false);
        seekBar.setEnabled(false);
    
        /* attach listener */
        attachProgressUpdatedListener(seekBar, positionOfItemInList);
    

    AttachProgressUpdatedListener

    this method attaches the listener to the seekbar, inside the arrayAdapter class

    private void attachProgressUpdatedListener(SeekBar seekBar,
        final int position) {
    
    seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
    
        public void onStopTrackingTouch(SeekBar seekBar) {
        int progress = seekBar.getProgress();
        int task_id = (Integer) seekBar.getTag();
    
        TaskHandler taskHandler = new TaskHandler(DBAdapter
            .getDBAdapterInstance(getContext()));
    
        taskHandler.updateTaskProgress(task_id, progress);
    
        mList.get(position).setProgress(progress);
    
        //need to fire an update to the activity
        notifyDataSetChanged();
        seekBar.setEnabled(false);
    
        }
    
        public void onStartTrackingTouch(SeekBar seekBar) {
        // empty as onStartTrackingTouch listener not being used in
        // current implementation
    
        }
    
        public void onProgressChanged(SeekBar seekBar, int progress,
            boolean fromUser) {
        // empty as onProgressChanged listener not being used in
        // current implementation
    
        }
    });
    
    }
    

    OnItemCLickListener

    this snipped is from the activity which houses the list view.

    taskListView.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view,
            int position, long id) {
        SeekBar sb = (SeekBar) view.findViewById(R.id.seek);
        sb.setFocusable(true);
        sb.setEnabled(true);
    
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView in which each item has a SeekBar. When I update
I have a list view where each textview is supposed to show the value
I have a ListView where each item represents a podcast. Selecting an item plays
So in my application, I have a seekbar that allows the user to set
I have one seekbar in my custom listview . Now i dont want that
I have a seekbar, while moving it I want to change values from 0
I want to have a SeekBar with a thumb that appears as the user
I am creating a color chooser from a SeekBar. So far, I have successfully
I have a ListView where each item represents a podcast that can run up
I have SeekBar with 3 value (left, on center and right) and I will

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.