Permalink
Browse files

initial import of Android Intent sample app

  • Loading branch information...
1 parent 178d813 commit 64c63bacce2720edfb5889086cf42a984fe45544 Tony Lukasavage committed Aug 26, 2011
Showing with 46 additions and 0 deletions.
  1. +46 −0 AndroidIntents/app.js
View
46 AndroidIntents/app.js
@@ -0,0 +1,46 @@
+Ti.UI.backgroundColor = '#000000';
+
+var win = Ti.UI.createWindow();
+var label = Ti.UI.createLabel({
+ text: 'Say Something!',
+ color:'#eeeeee',
+ font: {
+ fontSize:'20dp',
+ fontWeight:'bold'
+ },
+ height:'auto',
+ top:'5dp'
+});
+var textarea = Ti.UI.createTextArea({
+ width:'90%',
+ top:'44dp',
+ bottom: '70dp',
+ left:10,
+ right:10
+});
+var button = Ti.UI.createButton({
+ title:'Share',
+ height:'auto',
+ width:'auto',
+ font: {
+ fontSize:'24dp'
+ },
+ bottom:'10dp',
+ right:10
+});
+button.addEventListener('click', function(e) {
+ var intent = Ti.Android.createIntent({
+ action: Ti.Android.ACTION_SEND,
+ type: "text/plain"
+ });
+
+ intent.putExtra(Ti.Android.EXTRA_TEXT, textarea.value);
+ intent.addCategory(Ti.Android.CATEGORY_DEFAULT);
+ Ti.Android.currentActivity.startActivity(intent);
+});
+
+win.add(label);
+win.add(textarea);
+win.add(button);
+
+win.open();

0 comments on commit 64c63ba

Please sign in to comment.