In my app the user has the opportunity to take pictures and then view it in an ImageView. The problem is the image when viewing the photo turns 90 dregrees (if i take in portrait it appears in landscape). What am i doing wrong??
Taking photo:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File file = new File(Environment.getExternalStorageDirectory(), "/PROJETOS/"+nome+"/"+"proj"+id+"_reg"+id_reg+"_"+valor+".jpg");
nome_caminho = "proj"+id+"_reg"+id_reg+"_"+valor+".jpg";
outputFileUri = Uri.fromFile(file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, TAKE_PICTURE);
protected void onActivityResult(int requestCode, int resultCode, Intent data){
if (requestCode == TAKE_PICTURE){
mydb.execSQL("INSERT INTO fotos(id_regi,nome,caminho) VALUES('"+id_reg+"','"+nome_caminho+"','"+outputFileUri+"')");
}
Viewing it:
Options op = new Options();
op.inSampleSize = 5;
op.inJustDecodeBounds = false;
bm = BitmapFactory.decodeFile(caminhoNovo, op);
foto.setImageBitmap(bm);
Just turn it by 90 degree