-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set the init state #11
Comments
Yes how can we set initial state? |
In the onCreate(), Calling post before toggle is required, otherwise you will run into NULL error. I believe it may not be initialized. togglebtn.post(new Runnable() { |
@hongzhou85 is right. If you call the toggle method in your Activity's onCreate() callback you get a NullPointerException. Currently the runnable seems to be the only working solution (calling the toggle method in the onResume() callback isn't appropriate, imho). I did my own custom class which extends MaterialAnimatedSwitch and sets the initial state.. but the developer of this pretty library should take care of it. |
I'm getting stuck with this as well, I hope the developer will manage to fix this as soon as possible. |
I'm Having the same problem. It's too bad we have to call to the runnable each time we want to init the switch... hope it will be fixed soon :\ |
I also hope it will be fixed ASAP |
1 similar comment
I also hope it will be fixed ASAP |
is the any method to set init state?
The text was updated successfully, but these errors were encountered: