简体   繁体   中英

java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.support.constraint.ConstraintLayout$LayoutParams

java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.support.constraint.ConstraintLayout$LayoutParams

This error is coming when I add the BLE device in the list and click on the back button. if I click on that button without adding a BLE device then it won't crash.

If your layout is a LinearLayout the layout params class must be a LinearLayout.LayoutParams, if it's a ConstraintLayout then ConstraintLayout.LayoutParams, and so on. Those LayoutParams classes have specific methods for each layout type which are not mutually compatible

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM