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();
}
}
});
});
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
Closing ticket as invalid with reference to the above comments.