Pregunta

I have tabActivity with several child Activities. From activity A I start camera or gallery:

final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Utils.getImagePath().getPath());
intent.putExtra("return-data", true);
startActivityForResult(intent, Utils.CROPPER_PICK_FROM_CAMERA);

and

final Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, Utils.CROPPER_PICK_FROM_FILE);

The result is returned to Activity A

Also I have activity B, that makes image cropping (I start it from activity A). But it's result is returned to TabActivity (on some phones it returns to activity A). How can I prevent it?

EDIT:

I start activity B (which makes crop) from activity A (not from activity, from other class )

final CropStarter starter = new CropStarter(mContext);
starter.startCropping(path);

public void startCropping()
{
final Intent intent = new Intent(mContext, CropImage.class);
        intent.setData(mImagePath);
        intent.putExtra("return-data", true);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, Utils.getImagePath());
        intent.putExtra("outputFormat", "PNG");
        mContext.startActivityForResult(intent, Utils.CROPPER_CROP_FROM_CAMERA);
}

EDIT 2:

if I start activity B from A with this code:

final Intent intent = new Intent(this, CropImage.class);

it has the same result: result is returned to tabActivity

¿Fue útil?

Solución

So problem was that I forgot to add in the activity tag in manifest this:

android:configChanges="bla bla bla |screenSize

On some devices camera view fires screen size to change, so I did not handle this situation.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top