[AC-2109] Android: Pressing home button of device on camera overlay in portrait mode and re-opening the app gives an error message
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-08-09T21:36:41.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android |
Reporter | Blaga Mihai |
Assignee | Daniel Sefton |
Created | 2013-08-09T21:13:50.000+0000 |
Updated | 2016-03-08T07:41:05.000+0000 |
Description
*Problem*
Pressing home button of an Android device on camera overlay(which is in portrait mode) and re opening the app gives an error message in an alert box.
*Test Case*
1. Open the camera from a portrait mode screen
var win = Ti.UI.createWindow({
backgroundColor : '#FFF'
});
var label = Ti.UI.createLabel({
text : "Tap to show camera"
});
win.add(label);
win.open();
var cameraOverlayView = Ti.UI.createView({
height : '100%',
width : '100%'
});
win.addEventListener('click', function() {
var params = {
success : function(e) {
Ti.API.info('SUCCESS');
},
error : function(e) {
alert('ERROR ' + JSON.stringify(e));
},
cancel : function(e) {
Ti.API.info('CANCEL ' + e);
},
mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
overlay : cameraOverlayView
};
Ti.Media.showCamera(params);
});
2. Press Home button of Android device.
3. Re open the app.
4. The camera screen disappears and the following message is seen in an alert box:
1
{ "message": "Unable to setup preview surface:null" ,"code":-1,"error":"Unable to setup preview surface:null","success":false}
I know this is a duplicate of TIMOB-14423, but this is marked as resolved and it's not. I still have the problem, even in 3.1.2.v20130730133101 and 3.1.2.v20130807111603, but it's fixed in 3.2.0.v20130807110843. Can you include the fix in 3.1.2?
Sorry Blaga, I'll have to close this. The issue is fixed either way, so there's no need for another report. Our engineering team will answer your question in TIMOB-14423. Thanks.