LinearLayout.LayoutParams lp
=newLinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
lp.setMargins(10,20,30,40);
imageView.setLayoutParams(lp);
LinearLayout.LayoutParams lp
=newLinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
lp.setMargins(10,20,30,40);
imageView.setLayoutParams(lp);