Closed AndroidDeveloperLB closed 7 years ago
@AndroidDeveloperLB This crash happened in the sample without modifying it?
Edit:Oh, ok, I needed a nexus 5x to made it crash the same way, it wasn't happening in other devices i own. I'm on it
Why does it happen though?
Trying to parcel too many bytes while saving switch state (i guess it's all the toggles drawables, a lot of data) I guess i just have not to save the toggle images in the parcel.. But that way, you'll have to set the switch toggles every activity/fragment creation, i guess there's not other way I was warried about that since the beginning
Why save the drawables in there? Just save the state (turned off/on).
So that a developer do not have to set it every creation (I know, almost everyone do that, so I'm removing it)
Set on every creation? But that's how it works. You set it in XML or in code, right in onCreate (or when inflating)...
Yes, I know, but it seemed a nice thing for dynamic switch state images (anyway, you're right, I'm removing it right now)
Try out with the latest commit, it should be fixed! Thanks for the feedback
Thank you. BTW, seeing that you know about switches on Android, can you see why on my tiny library of Material Preferences doesn't show the switches animation : https://github.com/AndroidDeveloperLB/MaterialPreferenceLibrary/issues/22 ?
About the commit, for some reason I can't open the project anymore.
Ok, i'll check it out What's the problem?
I just cloned it and opened with android studio without problems.. have you tried updating the support libraries in your SDK manager? maybe it's that since i've updated the one in this project to the version 25.0.1
OK now I cloned it and it works fine.
Good! Closing the issue Thanks again for the feedback.
Say, does the sample supposed to have a disabled switch? the green one on the right bottom (above the last one) doesn't respond to touch on it.
Yes, if you check the MainActivity code, that particular switch has been disabled programmatically
(disabled switches also have an alpha to be distinguished from the enabled ones, if you check closely I think it can be seen, it's about 0.6 if I remember right)
Oh ok. Maybe you should put some text above it, to indicate that it is disabled.
@RiccardoMoro Have you checked the issue ?
Nope, I'm busy at work and with conferences this week and the next one, maybe after that I'll take a look
This is the log:
11-21 10:10:47.451 4055-4055/com.rm.switchsample E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 1160672) 11-21 10:10:47.453 4055-4055/com.rm.switchsample E/AndroidRuntime: FATAL EXCEPTION: main Process: com.rm.switchsample, PID: 4055 java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 1160672 bytes at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3755) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6088) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Caused by: android.os.TransactionTooLargeException: data parcel size 1160672 bytes at android.os.BinderProxy.transactNative(Native Method) at android.os.BinderProxy.transact(Binder.java:615) at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:3628) at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3747) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6088) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)