Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2109] Android: Pressing home button of device on camera overlay in portrait mode and re-opening the app gives an error message

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2013-08-09T21:36:41.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid
ReporterBlaga Mihai
AssigneeDaniel Sefton
Created2013-08-09T21:13:50.000+0000
Updated2016-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?

Comments

  1. Daniel Sefton 2013-08-09

    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.

JSON Source