[TIMOB-14423] 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 | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-07-02T18:14:58.000+0000 |
Affected Version/s | Release 3.1.1 |
Fix Version/s | n/a |
Components | Android |
Labels | android |
Reporter | Mukund Samant |
Assignee | Ingo Muschenetz |
Created | 2013-05-22T06:26:43.000+0000 |
Updated | 2017-03-16T21:01:23.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:
{ "message": "Unable to setup preview surface:null" ,"code":-1,"error":"Unable to setup preview surface:null","success":false}
Hi Any updates on this?Please let me know if more elaboration is required in the test case.
Tested and confirmed on Samsung Galaxy S2 2.3.6 with Ti SDK 3.1.1 GA. However, I don't get the "Unable to setup preview surface" error.
Pull request https://github.com/appcelerator/titanium_mobile/pull/4425
Updated test case. Should now see an alert with error in fail case.
The problem still exists on 3.1.1.GA, 3.1.2.v20130730133101, 3.1.2.v20130807111603 but it's fixed on 3.2.0.v20130807110843. The problem appears when locking the screen also. Can't the fix be included in the final 3.1.2?
Closing ticket as fixed.