Skip to content

Instantly share code, notes, and snippets.

@dai
Created July 11, 2012 05:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dai/3088158 to your computer and use it in GitHub Desktop.
Save dai/3088158 to your computer and use it in GitHub Desktop.
Example: Using Intent to Twitter. / by harukazepc(http://d.hatena.ne.jp/harukazepc/20111219/1324260914#intent)
var shareButton = Ti.UI.createButton({title:'share'});
shareButton.addEventListener('click',function(e) {
var shareText = 'share the text';
// ボタン押したら、ACTION_SEND対応のアプリへ暗黙インテント発行
var intent = Ti.Android.createIntent({
action: Ti.Android.ACTION_SEND
});
// EXTRA_TEXTとして、shareTextの内容を渡す
intent.putExtra(Ti.Android.EXTRA_TEXT,shareText);
Ti.Android.currentActivity.startActivity(intent);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment