Android Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsMobile ProgrammingAndroid Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 27th, 2012, 09:11 PM
Edu Varta Edu Varta is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Posts: 1 Edu Varta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 8 sec
Reputation Power: 0
Radio Button group logic

Hi,
I am trying to implement the logic for radio button group but it is not working. I want it to work like...

If radio button1 is selected and submit is clicked, activity1 is seen and if radio button2 is selected and submit is clicked, activity2 is seen.

can any one help me plz?

Reply With Quote
  #2  
Old January 6th, 2013, 01:07 AM
nghien_rbc nghien_rbc is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 nghien_rbc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 20 sec
Reputation Power: 0
Quote:
Originally Posted by Edu Varta
Hi,
I am trying to implement the logic for radio button group but it is not working. I want it to work like...

If radio button1 is selected and submit is clicked, activity1 is seen and if radio button2 is selected and submit is clicked, activity2 is seen.

can any one help me plz?


Make onClick listener for each radio button on Radio Group

PHP Code:
public void onRadioButtonClicked(View view) {
        
// Is the button now checked?
        
boolean checked = ((RadioButtonview).isChecked();
        
        
// Check which radio button was clicked
        
switch(view.getId()) {
            case 
R.id.radio0:
                if (
checked)
                       
// start your activity 1 here
                
break;
            case 
R.id.radio1:
                if (
checked)
                        
// start your activity 2 here
                
break;
        }
    } 

Reply With Quote
  #3  
Old January 9th, 2013, 03:36 AM
Brus Martin Brus Martin is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 24 Brus Martin Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 3 h 1 m 37 sec
Warnings Level: 10
Number of bans: 2
Reputation Power: 0
Quote:
Originally Posted by nghien_rbc
Make onClick listener for each radio button on Radio Group

PHP Code:
public void onRadioButtonClicked(View view) {
        
// Is the button now checked?
        
boolean checked = ((RadioButtonview).isChecked();
        
        
// Check which radio button was clicked
        
switch(view.getId()) {
            case 
R.id.radio0:
                if (
checked)
                       
// start your activity 1 here
                
break;
            case 
R.id.radio1:
                if (
checked)
                        
// start your activity 2 here
                
break;
        }
    } 


Not working any other solution ?

Reply With Quote
Reply

Viewing: Dev Shed ForumsMobile ProgrammingAndroid Development > Radio Button group logic

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap