I m working on project user to move the image in one position to Another position on the screen. I have written a sample code to move the image but the problem here is if I
Actually you can avoid this problem by declaring the images programmatically .
int id = getResources().getIdentifier("image1", "drawable", getPackageName());
ImageView imageView1 = new ImageView(this);
LinearLayout.LayoutParams vp =
new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
imageView1.setLayoutParams(vp);
imageView1.setImageResource(id);
someLinearLayout.addView(imageView1);
int id = getResources().getIdentifier("image2", "drawable", getPackageName());
ImageView imageView2 = new ImageView(this);
LinearLayout.LayoutParams vp1 =
new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
imageView2.setLayoutParams(vp1);
imageView2.setImageResource(id);
someLinearLayout.addView(imageView2);
and add touch events to the added imageviews