Created
July 11, 2012 05:19
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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