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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:56:33+00:00 2026-05-22T22:56:33+00:00

I am using three toggle buttons if I ON first button so all 3

  • 0

I am using three toggle buttons if I ON first button so all 3 Button should get disabled. Although I have written code but I am not getting, why it is not working. My Code is as follows..

import android.app.Activity;

import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;


import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.Toast;
import android.widget.ToggleButton;

import com.parser.XMLData;
import com.parser.XMLDataParser;

public class SyncDataPage extends Activity
{
    ToggleButton toggle_syncing;
    ToggleButton toggle_replace_data;
    ToggleButton toggle_replace_photos;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sync_data_page);

        initializeToggleButtons();
    }


    private void initializeToggleButtons()
    {
        toggle_syncing = (ToggleButton) findViewById(R.id.sync_data_toggle_syncing);
        toggle_replace_data = (ToggleButton) findViewById(R.id.sync_data_toggle_data_in_contacts);
        toggle_replace_photos = (ToggleButton) findViewById(R.id.sync_data_toggle_photos_in_contacts);
        toggle_syncing.setOnClickListener(new OnClickListener()
        {
            @Override
            public void onClick(View v)
            {
                if(toggle_syncing.isChecked())
                {
                    // Toast.makeText(getApplicationContext(), "Syncing Starts", Toast.LENGTH_SHORT).show();
                    toggle_syncing.setFocusable(false);
                    toggle_replace_data.setFocusable(false);
                    toggle_replace_photos.setFocusable(false);
                    btn_back.setFocusable(false);
                    bar_syncing.setVisibility(LinearLayout.VISIBLE);
                    new ContactsDataSync().execute();
                }
                else
                {
                    // Toast.makeText(getApplicationContext(), "toggle_syncing Unchecked", Toast.LENGTH_SHORT).show();
                }
            }
        });


        toggle_replace_data.setOnClickListener(new OnClickListener()
        {
          @Override
          public void onClick(View v)
          {
              if(toggle_replace_data.isChecked())
              {
                  // Toast.makeText(getApplicationContext(), "toggle_replace_data Checked", Toast.LENGTH_SHORT).show();
              }
              else
              {
                  // Toast.makeText(getApplicationContext(), "toggle_replace_data Unchecked", Toast.LENGTH_SHORT).show();
              }
          }
        });


        toggle_replace_photos.setOnClickListener(new OnClickListener()
        {
          @Override
          public void onClick(View v)
          {
              if(toggle_replace_photos.isChecked())
              {
                  // Toast.makeText(getApplicationContext(), "toggle_replace_photos Checked", Toast.LENGTH_SHORT).show();
              }
              else
              {
                  // Toast.makeText(getApplicationContext(), "toggle_replace_photos Unchecked", Toast.LENGTH_SHORT).show();
              }
          }
        });
    }
  • 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-22T22:56:34+00:00Added an answer on May 22, 2026 at 10:56 pm

    Use setEnabled(false) instead of setFocusable(false).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three images and using the following code I have then fade in
I have three applications that talk to each other using sockets. They can all
I have a <button> with a nested image and I'm using jQuery to toggle
Consider i am using join on three tables to get a desired result-set... Now
Using MySQL, I have three tables: projects : ID name 1 birthday party 2
I am using jquery UI tabs I have three ajax tabs like so: <div
I'm using JQuery. I'm writing this as HTML code: <li id=toggle> <a id=open class=open
I want to create a toggle button in html using css. I want it
I am using C# and WPF and I basically want to have some toggle
I have three radio buttons in a search group: Zip, City and County. How

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.