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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:38:00+00:00 2026-06-11T17:38:00+00:00

What is the error in radioButton1.getText().toString().equals() in code below? I want to force the

  • 0

What is the error in radioButton1.getText().toString().equals("") in code below?

I want to force the user to fill in this field and if he leaves the field empty then toast a message that fills the required field. How do I do this?

page1.setOnClickListener(new View.OnClickListener() { 

public void onClick(View v) { 
    if(radioButton1.getText().toString().equals("")||radioButton2.getText().toString().equals("")||radioButton3.getText().toString().equals("")||radioButton4.getText().toString().equals("")
||petn.getText().toString().equals("")||breed.getText().toString().equals("")||color.getText().toString().equals("")||alergic.getText().toString().equals("")||ath_locat.getText().toString().equals("")||d_condi.getText().toString().equals("")||weight1.getText().toString().equals("")
    )
    { 
    Log.e("onclick", ",pd"); 
    Toast msg = Toast.makeText( 
    My2Activity.this,"Please fill the * required field",Toast.LENGTH_LONG); 
    msg.show(); 
     } 
    else{ 
    PostData(); 
    Intent d = new Intent(getApplicationContext(), 
    My1Activity.class); 
    startActivity(d); 
    } 
    } 
    });
  • 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-11T17:38:01+00:00Added an answer on June 11, 2026 at 5:38 pm
    if(radioButton1.isChecked())
    {
    
    }
    else
    {
    
    }
    

    you want to set OnCheckedChangeListener to radio button

    radioButton1.setOnCheckedChangeListener(new RadioButton.OnCheckedChangeListener()
    {
    @Override
    public void onCheckedChanged(CompoundButton arg0, boolean arg1) 
    {
    
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented an error style for textboxes using the following code. This sets
I am getting this error by simply trying to insert some VB.NET code in
Error display as Incorrect syntax near '@Cmp_DocPath', if i use comment Line code I
Error code: Timeout Expired. The timeout period elapsed prior to completion of the operation
In the following code I'll get the following error if I right click the
I want to be able to off the user a choice of options and
I wrote this code and I am trying to figure out what I have
Okay I'm almost about to quit this ASP.NET SHYTE.. ;( I usually code clients
I'm using custom radiobuttons with a SQLFORM as shown below: def radioboxes(field,value): items=[DIV(name,INPUT(_type='radio',_value=key,_name=field.name,value=value), _class='radio')
I Successfully created an user control for displaying Error message. now everything works fine

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.