Created
June 27, 2013 22:35
-
-
Save egomez99/5881010 to your computer and use it in GitHub Desktop.
Start an activity and download a remote image
This file contains hidden or 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 win = Ti.UI.createWindow({ | |
layout : 'vertical', | |
backgroundColor : "#b5aea5" | |
}); | |
//attempt to start an activity while Image is downloading | |
var intent = Ti.Android.createIntent({ | |
action : Ti.Android.ACTION_CALL, | |
data : 'tel:0133' + 31361035 | |
}); | |
Ti.Android.currentActivity.startActivity(intent); | |
var imageURL = 'https://addons.opera.com/media/extensions/95/91595/1.0.3-rev2/icons/icon_64x64.png'; | |
var image = Ti.UI.createImageView({ | |
top : 15, | |
image : imageURL | |
}); | |
image.addEventListener('click', function() { | |
Ti.API.info(' Clicked the Image!'); | |
}); | |
win.add(image); | |
var view = Ti.UI.createView({ | |
top : 15, | |
backgroundImage : imageURL | |
}); | |
view.addEventListener('click', function() { | |
Ti.API.info(' Clicked the View!'); | |
}); | |
win.add(view); | |
win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment