Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-14423

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: Release 3.1.1
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
    • Environment:

      Device:
      iball Andi4.5q Jelly Bean 4.1.1

      SDK version:
      3.1.1.v20130520171545

      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}

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ingo Ingo Muschenetz
                Reporter:
                mukundsamant89 Mukund Samant
                Reviewer:
                Allen Yeung
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-16886
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration