[AC-3112] Intent Result Activity return Image objects is null
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2013-01-22T14:16:30.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android, image, intent, resultactivit |
Reporter | Gnanaoly |
Assignee | Betty Tran |
Created | 2012-07-18T23:44:00.000+0000 |
Updated | 2016-03-08T07:48:10.000+0000 |
Description
The Android intent result activity will get the image objects and image path.
But Titanium supporting only for returning the image path . Please review my queries and let me know.
Huawei U8650 will returning the image path is null. "It will return the image object."
I have explained the both titanium and android code : The Titanium intent result activity not supporting the object return.
var win = Ti.UI.createWindow();
var address = "Take the Picture"; var lblAddress = Titanium.UI.createLabel({ text: "link an adress :)", color: 'blue', font: { fontSize: 14, fontWeight: 'normal' }, width: 'auto', textAlign: 'left', top: 1, left: 10, height: 'auto' }); var intent; lblAddress .addEventListener('click',function(){
intent = Titanium.Android.createIntent({ action: 'android.media.action.IMAGE_CAPTURE',type: 'jpg' });
var ImageUri = null var fileNativePath1 = null;
Titanium.Android.currentActivity.startActivityForResult(intent, function(e) { if (e.error) {
Ti.UI.createNotification({
duration: Ti.UI.NOTIFICATION_DURATION_LONG,
message: 'Error: ' + e.error
}).show();
} else {
if (e.resultCode === Titanium.Android.RESULT_OK) {
fileNativePath1 = e.intent.data; // Huawei U8650 will returning the image path is null
var image1 = fileNativePath1;
var tmp = jpglib.Resize(fileNativePath1,activity2);// code for resizing the image
anImageView.image = tmp;
var img1str = Ti.Utils.base64encode(tmp);
var setimg1str = Ti.App.Properties.setString('getimg1str', img1str);
}
}
});
});
win.add(lblAddress); win.open();
Hi Gnanaoly, I am able to return the image path using the following code:
Are you able to return the image path using the code?