Camera.getPicture refreshes app on selection


#1

I’m currently doing:

var options = 
{
    	sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
    	destinationType: Camera.DestinationType.FILE_URI
};

Camera.getPicture(options).then((imageData) => 
{
    this.base64Image = imageData;
}, (err) => 
{
    console.log(err);
});

The code works as expected, displaying the phones gallery, allowing photos to be selected, however, on confirmation the gallery closes and the application refreshes. I cannot find anything online which gives me insight into the issue.

Furthermore, the following stops the application from working on confirmation, i cannot seem to get back to my application when selecting images.

let options =
{
	maximumImagesCount: 1,
	quality : 75
};

ImagePicker.getPictures(options).then((results) =>
{
	this.base64Image = "data:image/jpeg;base64," + results[0];
}, (error) => {
	console.log("ERROR -> " + JSON.stringify(error));
});

Note: I am building to a Android Device for testing purposes (S7 to be precise)

Thanks, Jordan.

__________ EDIT ________________

It appears the application is put to the background whilst the camera functionality is open, this results in my app being killed. Does anyone know how to get around this?

__________ EDIT ________________

SOLVED! On my S7 within Developer options, i had “kill apps as soon as they go to background” toggled on. What a pain.