Skip to content

Instantly share code, notes, and snippets.

@oguya
oguya / imageLoader.java
Created January 6, 2014 07:45
Load image from URL to an ImageView
//ImageLoader lib => http://search.maven.org/remotecontent?filepath=com/novoda/imageloader/imageloader-core/1.5.8/imageloader-core-1.5.8.jar
String image_url = "http://mycodeandlife.files.wordpress.com/2013/01/384088_2317070728022_2086719259_n.jpg";
ImageView image = (ImageView) findViewById(R.id.imageView1);
// Get singletone instance of ImageLoader
ImageLoader imageLoader = ImageLoader.getInstance();
// Initialize ImageLoader with configuration. Do it once.
imageLoader.init(ImageLoaderConfiguration.createDefault(this));
// Load and display image asynchronously
DisplayImageOptions options = new DisplayImageOptions.Builder()
@oguya
oguya / !request_user_id.py
Created December 5, 2013 12:25
get userid without using request object
from django.contrib.auth.models import User
User.objects.get(username=the_username).pk