Skip to content

Instantly share code, notes, and snippets.

@ssx
Created April 12, 2017 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssx/442f5ab472cfe58439870c9e6b2e99d4 to your computer and use it in GitHub Desktop.
Save ssx/442f5ab472cfe58439870c9e6b2e99d4 to your computer and use it in GitHub Desktop.
test.js
exports.sendViaBluetooth = function(file, title) {
var intent = Ti.Android.createIntent({
action: Ti.Android.ACTION_SEND
});
// File contains a tifileobject.nativePath
intent.putExtraUri(Ti.Android.EXTRA_STREAM, file);
var share = Ti.Android.createIntentChooser(intent, title);
Ti.Android.currentActivity.startActivityForResult(share, function(e) {
// This never fires
Ti.API.info("Finished intent:");
Ti.API.info(JSON.stringify(e, 0, 2));
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment