Questions tagged [android-switch]

Switch is an android class for a two state toggle switch

From Android Developer Documentation:

A Switch is a two-state toggle switch widget that can select between two options. The user may drag the "thumb" back and forth to choose the selected option, or simply tap to toggle as if it were a checkbox. The text property controls the text displayed in the label for the switch, whereas the off and on text controls the text on the thumb. Similarly, the textAppearance and the related setTypeface() methods control the typeface and style of label text, whereas the switchTextAppearance and the related seSwitchTypeface() methods control that of the thumb.

The Android Developer Guide regarding toggle buttons also states, that

The ToggleButton and Switch controls are subclasses of CompoundButton and function in the same manner, so you can implement their behavior the same way.

201 questions
-1
votes
2 answers

Switch button perform hide splash screen

I'm using Switch button (if switch button on its disable splash else working normal) for Disable splash screen. But I can't doing it. I'm try android-activity-alias but I'm not get any success. Please help me. (Also I'm using Android-Studio 2.3.0).…
-2
votes
1 answer

How can we differentiate between State Changes of the Switch set programmatically to the ones set by user?

I have a Switch. It works like this 1. Turn it ON shows you AlertDialog with Download/locate/cancel options to perform (download)/(locate locally)/(cancel the dialog) 2.Turn it OFF shows you AlertDialog with Yes/No options to delete the files Now…
-2
votes
3 answers

Save Switch Button State via Shared Preferences When App is Closed

In my Activity I have an Switch Button. I wanted to keep the State of the Switch Button when the App closes from the background. The State of the Switch remains when the App is there in the Background but it goes back to the default (OFF) state when…
-2
votes
1 answer

android switch inside listview got initial state after scrolling

I have a listview with a textview and switch.The listview is inside a settings page fragment.while clicking swiches,some settings gets changed(ON/OFF).Its works fine for me.Consider a situation,if i changed the third switch state from ON to OFF and…
kannan
  • 317
  • 1
  • 4
  • 12
-3
votes
1 answer

How can I use Shared Preferences to save ToggleButton/Switch status?

I've already implemented Firebase push notifications to my app successfully, but now I want the ToggleButton/Switch to store the user selection, I mean, when the user activate the switch I want that status to be stored, because when the user closes…
1 2 3
13
14