I wanted to rotate the images as much as the user clicks on rotate button.The code below makes the image rotated correctly but my image is becoming blur.
I've been using the code below:
backLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
for(int i=0;i<selectedImageList.size();i++) {
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
Bitmap scaledBitmap = BitmapFactory.decodeFile(selectedImageList.get(i), bmOptions);
Matrix matrix=new Matrix();
matrix.preRotate(0);
Bitmap rotatedBitmap = Bitmap.
createBitmap(scaledBitmap , 0, 0, scaledBitmap .getWidth(), scaledBitmap .getHeight(), matrix, true);
File file=Utility.createFileFromBitmap(rotatedBitmap);
File oldFile=new File(selectedImageList.get(i));
LogUtil.error("Deleted Name",oldFile.getAbsolutePath()+"-->"+file.getAbsolutePath());
oldFile.delete();
itemList.set(selectedImages.get(i),file.getAbsolutePath());
selectedImageList.set(i,file.getAbsolutePath());
mSnapRecyclerAdapter.notifyDataSetChanged();
}