How to set On click listener on the Radio Button in android

I have two radio button inside the radio group now I want to set On click listener on that radio button. When One radio button is clicked Edit Text text has to change when I click on the Other Radio button text of the same edit Text has changed.

Answers


I'd think a better way is to use RadioGroup and set the listener on this to change and update the View accordingly (saves you having 2 or 3 or 4 etc listeners).

    RadioGroup radioGroup = (RadioGroup) findViewById(R.id.yourRadioGroup);        
    radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() 
    {
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            // checkedId is the RadioButton selected
        }
    });

Need Your Help

MVC 3 Simple Inheritance

c# asp.net-mvc inheritance

I have come across a situation where the answer should be really straight forward, but it eludes me.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.