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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:22:27+00:00 2026-06-01T16:22:27+00:00

i just download wheel picker sample project. In that project what ever select in

  • 0

i just download wheel picker sample project. In that project what ever select in wheel picker it update in text view. Here i changed that text view into button, if i click that button mean it will show the value in wheel picker. its possible or not?

here my sample code:

     public void onCreate(Bundle savedInstanceState)
            {
                 super.onCreate(savedInstanceState);
               setContentView(R.layout.test_wheel_layout);              

                bundle = new Bundle();
                wheelArrayList = new ArrayList<String>();
                bundle = getIntent().getExtras();               


                wheelArrayList = (ArrayList<String>) bundle.get("ItemKey");     
                wheelMenu1 = wheelArrayList.toArray(new String[wheelArrayList.size()]); 
                initWheel1(R.id.p1);            


                btnCurrentSelection = (Button) this.findViewById(R.id.btn_FrstSelection);           

                btnCurrentSelection.setText(bundle.getString("selectedValue"));                 




                btnCurrentSelection.setOnClickListener(new View.OnClickListener() {

                    @Override
                    public void onClick(View v) {
                        // TODO Auto-generated method stub


                        //OnWheelChangedListener();
                    }
                });

            }


        // Wheel scrolled listener
        OnWheelScrollListener scrolledListener = new OnWheelScrollListener()
            {
                public void onScrollStarts(WheelView wheel)
                    {
                        wheelScrolled = true;
                    }

                public void onScrollEnds(WheelView wheel)
                    {
                        wheelScrolled = false;
                        updateStatus();
                    }
            };

        // Wheel changed listener
        private final OnWheelChangedListener changedListener = new OnWheelChangedListener()
            {
                public void onChanged(WheelView wheel, int oldValue, int newValue)
                    {
                        if (!wheelScrolled)
                            {
                                updateStatus();
                            }
                    }
            };

        /**
         * Updates entered PIN status
         */
        private void updateStatus()
            {           
            PreferenceConnector.writeString(WheelActivity.this, itemKeyName, wheelMenu1[getWheel(R.id.p1).getCurrentItem()]);
            }           
            }

        /**
         * Initializes wheel
         * 
         * @param id
         *          the wheel widget Id
         */

        private void initWheel1(int id)
            {
                WheelView wheel = (WheelView) findViewById(id);
                wheel.setAdapter(new ArrayWheelAdapter<String>(wheelMenu1));
                wheel.setVisibleItems(5);
                wheel.setCurrentItem(0);
//              text.setText(""+wheel.getCurrentItem());
                wheel.addChangingListener(changedListener);
                wheel.addScrollingListener(scrolledListener);
            }


        /**
         * Returns wheel by Id
         * 
         * @param id
         *          the wheel Id
         * @return the wheel with passed Id
         */
        private WheelView getWheel(int id)
            {
                return (WheelView) findViewById(id);
            }

        /**
         * Tests wheel value
         * 
         * @param id
         *          the wheel Id
         * @param value
         *          the value to test
         * @return true if wheel value is equal to passed value
         */
        private int getWheelValue(int id)
            {
                return getWheel(id).getCurrentItem();
            }

any one help me, how to focus

  • 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-01T16:22:28+00:00Added an answer on June 1, 2026 at 4:22 pm

    now i got the solution. here code

    btnCurrentSelection.setOnClickListener(new View.OnClickListener() {
    
            @Override
            public void onClick(View v) {
    
                int id = getIndex(wheelMenu1, btnCurrentSelection.getText()
                        .toString());
                getWheel(R.id.p1).setCurrentItem(id);
    
            }
        });
    
    
     public int getIndex(String[] array, String specificValue) {
    
        for (int i = 0; i < array.length; i++) {
    
            if (array[i].equals(specificValue)) {
    
                return i;
    
            }
    
        }
    
        return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new in Maven,Java and Eclipse. I just download a project that uses Maven.
Just wondering if there is any benchmark software that I can download that will
I am new to RoR. I just download some sample codes and deploy the
I just download ASP.NET MVC 2 Preview 2, create a new project and run
I've done numerous searches and I realize that I can just download this file
UPDATE: I decided to just download the demo off the website and build the
It seems like typical crawlers that just download a small number of pages or
I have just download the .deb and installed it. It works. Now i want
When I download something using gem I'd like to be able to just download
I'm giving a user a link to download a csv file ...just using Click

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.