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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:42:42+00:00 2026-05-21T20:42:42+00:00

In my program I would like to use two sets of wheels like the

  • 0

In my program I would like to use two sets of wheels like the following:

hours = (WheelView) findViewById(R.id.hour);
NumericWheelAdapter hourAdapter = new NumericWheelAdapter(this, 0, 23, "%02d");
hourAdapter.setItemResource(R.layout.wheel_text_item);
hourAdapter.setItemTextResource(R.id.text);
hours.setViewAdapter(hourAdapter);
hours.setCyclic(true);

These wheels have a scrollinglistener hours.addScrollingListener(scrolledListener);

The scrollinglistener looks like this:

// Wheel scrolled listener
OnWheelScrollListener scrolledListener = new OnWheelScrollListener() {
    public void onScrollingStarted(WheelView wheel) {
    }
    public void onScrollingFinished(WheelView wheel) {
    update();
    }
};

I would like to set one wheel with the value of the other but when I instantiate two listeners and scroll the first one it goes on setting wheel one and then wheel two and then wheel one again.

Is it possible to disable a one of the two scrolledListener?

I’ve tried this:

    hours.addScrollingListener(null);
    hours.setEnabled(false);

But this gave an error and the program had to be stopped.

Thanks for your help!

PS: the wheels are from
* Android Wheel Control.
* https://code.google.com/p/android-wheel/

  • 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-05-21T20:42:43+00:00Added an answer on May 21, 2026 at 8:42 pm

    I’ve contacted the designer, Yuri, of the wheel that i’m using and he gave me the following solution which works:

    // Wheel scrolled listener
    OnWheelScrollListener scrolledListener = new OnWheelScrollListener() {
        boolean syncInProgress = false;
    
        public void onScrollingStarted(WheelView wheel) {
        }
        public void onScrollingFinished(WheelView wheel) {
    
            if (syncInProgress) {
                syncInProgress = false;
                return;
            }
    
            syncInProgress = true;
            if (wheel.getId() == R.id.wheel1) {
                // do something
            } else if (wheel.getId() == R.id.wheel2) {
                // do something else
            }
        }
    };
    

    Thank you all for your help!

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

Sidebar

Related Questions

I would like to use Swing to program a simple learning game. I am
I would like my program to update itself (downloading a new exe and/or some
I am new to apple and would like to learn to program web sites
Ultimately I would like to use a Java program to send and receive messages
I would like to write a program that sets an environment variable in an
I would like to use python to make system calls to programs and time
I use tabs for indentation in my python programs, but I would like to
I'm trying to link 10 computers together, the program I would like to write
I have a program which I would like to run every X min the
I have a single user java program that I would like to have store

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.