I am working on an application that uses drag and drop on images. I can add any number of images to the relative layout. I can drag and drop images, but only one at a time. As soon as I add a new image, all previous images will not be pleasant.
public void addImage(Bitmap bmp) { ivtest= new ImageView(TabletActivity.this); if(bmp!=null) { ivtest.setImageBitmap(bmp); rlAddView.addView(ivtest, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); bmp= null; } ivtest.setTag("sdjfjd"); ivtest.bringToFront(); ivtest.setScaleType(ScaleType.MATRIX); ivtest.setOnTouchListener(this); }
this is the code in which i add a new image. Ivtest is a global imageView.
public class TestImage extends View implements OnTouchListener { private ScaleGestureDetector mScaleDetector; private float mScaleFactor = 1.f; private Drawable mIcon; private float mLastTouchX; private static final int INVALID_POINTER_ID = -1;
}
source share