I need to place multiple new ImageViews in my layout. The problem is that one comes on top of another exactly at the same location. Although I change the location, it only relates to the first one. They both are at 80,80.
RelativeLayout.LayoutParams lp1 = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
addpPicD(lp1,80,80);
addpPicD(lp1,100,100);
}
private void addpPicD(LayoutParams lp, int Lan, int Lon)
{
lp.setMargins(Lan, Lon, 0, 0);
ImageView imageView = new ImageView(this);
imageView.setImageResource(R.drawable.dot_bl);
imageView.setLayoutParams(lp);
rel.addView(imageView);
}