Skip to content

Instantly share code, notes, and snippets.

@egomez99
Created June 27, 2013 22:35
Show Gist options
  • Save egomez99/5881010 to your computer and use it in GitHub Desktop.
Save egomez99/5881010 to your computer and use it in GitHub Desktop.
Start an activity and download a remote image
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