Code example for ImageView.ScaleType

Methods: ordinal

0
		try { 
 
			InputStream is = (InputStream) fetch(url);
			BitmapDrawable d = (BitmapDrawable) ScaleDrawable.createFromStream(
					is, "src");
			d.setGravity(ScaleType.CENTER.ordinal());
			MyImageView iv = new MyImageView(context, url, txt);
			iv.setImageDrawable(d);
			return iv;
		} catch (MalformedURLException e) {
			e.printStackTrace();
			return null; 
		} catch (IOException e) {
			e.printStackTrace();
			return null; 
		} 
	} 
 
	private static Object fetch(String address) throws MalformedURLException,
			IOException { 
Contextual code suggestions in your IDE  Get Codota for Java