java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.Gallery$LayoutParams
Solution 1:
find import android.view.ViewGroup.LayoutParams;
this line and replace with import android.widget.LinearLayout.LayoutParams;
this line