[AC-3401] hello
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2016-03-22T19:26:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Sharif AbuDarda |
Assignee | Shak Hossain |
Created | 2016-03-22T19:25:28.000+0000 |
Updated | 2016-03-22T19:26:18.000+0000 |
Description
var filename = 'someImage.jpg';
var file = Titanium.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, filename);
var window = Ti.UI.createWindow({
backgroundColor: 'white'
});
var imageView = Ti.UI.createImageView({
top: 0,
width: '100%',
image: file.nativePath
});
var shareButton = Ti.UI.createView({
height: 100,
width: 200,
backgroundColor: 'purple',
bottom: 0,
});
window.add(imageView);
window.add(shareButton);
shareButton.addEventListener('click', function() {
alert('shareClick');
var shareIntent = Ti.Android.createIntent({
action: Ti.Android.ACTION_SEND,
type: "image/jpeg"
});
shareIntent.putExtra(Ti.Android.EXTRA_TITLE, 'title');
shareIntent.putExtra(Ti.Android.EXTRA_TEXT, 'text');
shareIntent.putExtraUri(Ti.Android.EXTRA_STREAM, file.nativePath);
Ti.Android.currentActivity.startActivity(Ti.Android.createIntentChooser(shareIntent, 'share'));
});
window.open();
No comments