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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:43:54+00:00 2026-05-26T19:43:54+00:00

I am having a silly issue with onClickListeners modifying GUI elements. Below I have

  • 0

I am having a silly issue with onClickListeners modifying GUI elements. Below I have a radioGroup holding two buttons, an EditText and a Spinner. When the choose_old radio button is selected, I simply wanted to toggle enable/disable between the Spinner and EditText. The variables select_run and new_run_name are both instance variables and are
obtained from my XML files.

select_run = (Spinner)runDialoglayout.findViewById(R.id.run_choice_spinner);
new_run_name = (EditText)runDialoglayout.findViewById(R.id.new_run_name);
RadioButton choose_old = (RadioButton)runDialoglayout.findViewById(R.id.select_old);
RadioButton choose_new = (RadioButton)runDialoglayout.findViewById(R.id.select_new);

choose_old.setOnClickListener(new OnClickListener(){
   public void onClick(View arg0) {
     Log.e("ERROR","GOT CLICK");
     select_run.setEnabled(true);
     new_run_name.setEnabled(false);        
   }
});

The ‘GOT CLICK’ message prints but I do not get the desired changes.

Note:

  1. In trying solutions, I had wrapped the GUI changes in a handler.post with no effect.
  2. If I set to enabled outside the onClickListener, it successfully changes it.

I’ve no doubt this is something dumb but can’t seem to figure out why this is happening

  • 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-26T19:43:55+00:00Added an answer on May 26, 2026 at 7:43 pm

    Try putting this code in the listener.

     boolean b = select_run.isEnabled();
     select_run.setEnabled(!b);
     new_run_name.setEnabled(b);        
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue trying to divide two decimals and then display the result.
Hopefully my issue isn't too silly but I'm having the following problem... I'm importing
This may seem like a silly question, but we are having an issue debugging
I'm having a seemingly silly problem with my gcc compiler. I have installed MinGW
So we have an issue with using a silly item/product based shipping, aka the
I'm having a rather silly problem. I'll simplify the situation: I have a table
Hey guys. I'm having this silly issue with inserting text with forwardslash into cart
I'm having a really silly issue... basically I'm working on a site on a
I'm having what must be a VERY SILLY issue with the Data Contract Serializer.
Possibly a silly question, but I'm having no luck finding an answer. Using Visual

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.