So I have this code: android studio marks casts as redundant.
But if I remove casts I will get compile error:
Error:(42, 29) Type mismatch: cannot convert from View to Button
Error:Execution failed for task ':app:transformJackWithJackForDebug'. com.android.build.api.transform.TransformException: com.android.builder.core.JackToolchain$ToolchainException: Jack compilation exception
What am I doing wrong? Android Studio v2.3.3