Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13522] Android:Video camera does not fire the callback on startActivityForResult on save

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2013-05-09T12:39:46.000+0000
Affected Version/sRelease 3.0.0, Release 3.0.2
Fix Version/sn/a
ComponentsAndroid
LabelssupportTeam
ReporterRupesh Sharma
AssigneeSunila
Created2013-04-11T13:29:19.000+0000
Updated2017-03-23T20:47:57.000+0000

Description

Description

Video camera after recording is done does not fire the callback for startActivityForResult on clicking the save button.

Test code

var intent = Titanium.Android.createIntent({ action: 'android.media.action.VIDEO_CAPTURE' });
    Titanium.Android.currentActivity.startActivityForResult(intent, function(e) {
        alert('daz3');
        if (e.error) {
            alert('daz2');
            Ti.UI.createNotification({
                duration: Ti.UI.NOTIFICATION_DURATION_LONG,
                message: 'Error: ' + e.error
            }).show();
        } else {
            alert('daz2');
            if (e.resultCode === Titanium.Android.RESULT_OK) {
                videoUri = e.intent.data;
                Ti.UI.createNotification({
                    duration: Ti.UI.NOTIFICATION_DURATION_LONG,
                    message: 'Video captured; now share or save it!'
                }).show();
                // note that this isn't a physical file! it's a URI in to the MediaStore.
                shareButton.visible = true;
                saveButton.visible = true;
            } else {
                Ti.UI.createNotification({
                    duration: Ti.UI.NOTIFICATION_DURATION_LONG,
                    message: 'Canceled/Error? Result code: ' + e.resultCode
                }).show();
            }
        }
    });

});

Comments

  1. Sunila 2013-05-09

    The sample code has issues. If I fix the code and run it, the callback is executed. If this code is associated with a window created with setting the property 'navBarHidden' in createWindow, then instead of using Android.currentActivity, it should refer to getActivity() of the created window. Setting the property 'navBarHidden' in createWindow will create a new Activity and js context. The code Ti.Android.currentActivity here, refers to the app main activity and the callback won't get called until that activity is active
  2. Lee Morris 2017-03-23

    Closing ticket as invalid with reference to the above comments.

JSON Source