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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:23:43+00:00 2026-06-08T18:23:43+00:00

I am testing my application on various models and I have realized that the

  • 0

I am testing my application on various models and I have realized that the toggle button ON and OFF event is not working. This is the list of devices:

Samsung YS5360
Samsung Galaxy Note
Samsung S Plus
HTC Sensation XE
HTC Wildfire S
Motorola RAZR
LG Optimus Black
Sony Ericsson Xperia neo V

I am not sure what I am doing wrong as I have followed all Android specifications. These events work on other devices. May I have some help please,anyone?

[RE-EDIT]

This is how I am implementing the listener:

    @Override
    public void onCheckedChanged(CompoundButton arg0, boolean change) {

        if(change){
            if(text.containsKey("on")){
                // do something
            }
        }else{
            if(text.containsKey("off")){
                // do something
            }
        }
        if(text.containsKey("clicked")){
            // do something
        }
     // }
   }
};

I check for both ON and OFF states but this seems not to be working on other devices.

  • 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-08T18:23:44+00:00Added an answer on June 8, 2026 at 6:23 pm

    Try This Code

        toggle=(ToggleButton)findViewById(R.id.tglbtn);
        toggle.setOnClickListener(new OnClickListener() {
              public void onClick(View v) {
               // TODO Auto-generated method stub
              if(toggle.isChecked())
              {
               Toast.makeText(getApplicationContext(), "The state is changed to on", Toast.LENGTH_LONG).show();
               }
                else
                {
                  Toast.makeText(getApplicationContext(), "The state is changed to off", Toast.LENGTH_LONG).show();
                 }
                 }
                 });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to begin unit testing our application, because I believe that this is
I have a .NET 3.5 Windows Service. I'm testing with a small application that
When testing performance of various web pages on my web application I noticed that
Hai Friends, I have developed an application which en-composes list views and posted that
I have written a psychological testing application, in which the user is presented with
I'm testing my application as grails run-app. I have read How to remove app
So essentially this project builds a portal of testing results from various test types.
I have an application that, as any other app, crashes once in a while
I have an application that sometimes will utilize a large amount of data. The
I have an iphone application. Should i do unit testing or UI tesitng or

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.