Commit 10ba73be by German Callejas

Issue #960 arreglado

parent b6af742c
......@@ -1114,17 +1114,13 @@ protected void showOnlyTape(boolean onlyTape) {
case GALLERY_PIC_REQUEST: //Galeria
if(data!=null){
Uri selectedImage = data.getData();
String[] filePathColumn = {MediaStore.Images.Media.DATA};
Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String filePath = cursor.getString(columnIndex);
cursor.close();
imagen = BitmapFactory.decodeFile(filePath);
this.launchEditPictoActivity(imagen);
Bitmap bitmap = null;
try {
bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), selectedImage);
} catch (IOException e) {
e.printStackTrace();
}
this.launchEditPictoActivity(bitmap);
}
break;
case EditPictoActivity.EDIT_PICTO_REQUEST:
......@@ -1179,6 +1175,7 @@ protected void showOnlyTape(boolean onlyTape) {
* @param image
*/
public void launchEditPictoActivity(Bitmap image){
Intent intent = new Intent(this, EditPictoActivity.class);
if(image!=null) {
......@@ -1199,7 +1196,6 @@ protected void showOnlyTape(boolean onlyTape) {
intent.putExtra(EditPictoActivity.IMAGE_PICTO, byteArray);
intent.putExtra(Picto.JSON_ATTTRS.EXPRESSION, getIntent().getStringExtra(Picto.JSON_ATTTRS.EXPRESSION));
startActivityForResult(intent, EditPictoActivity.EDIT_PICTO_REQUEST);
}
......
......@@ -44,7 +44,7 @@ public class EditPictoActivity extends Activity {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.edit_picto_layout);
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
LinearLayout ll = (LinearLayout)findViewById(R.id.image_layout);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment