When I try to change the width and height of my imageView the app crashes
Java code
final ImageView imageView1 = (ImageView)findViewById(R.id.imageView1);
imageView1.setLayoutParams(new LinearLayout.LayoutParams(50, 50));
The app crashes saying
08-22 15:14:33.670 E/AndroidRuntime(9917):
java.lang.ClassCastException:android.widget.LinearLayout$LayoutParams cannot be cast to
android.widget.RelativeLayout$LayoutParams