Code example for BitmapFactory.Options

Methods: decodeStream

0
			URL url = new URL(user.iconUrl);
			HttpURLConnection connection = (HttpURLConnection) url.openConnection();
			connection.setDoInput(true);
			connection.connect();
			InputStream input = connection.getInputStream();
			Options opt = new Options();
			opt.inPurgeable = true; // GC�”\�ɂ���
			Bitmap bm = BitmapFactory.decodeStream(input, null, opt);
			File file = Client.getApplicationFile(IconCaches.genIconName(user));
			FileOutputStream fos = new FileOutputStream(file);
			bm.compress(CompressFormat.PNG, 90, fos);
			fos.close();
			Icon icon = new Icon(bm, IconCaches.genIconName(user));
			IconCaches.putIconToMap(user.userId, icon);
			LogHelper.printD("icon get from web"); 
			return icon.use();
		} 
		catch (Exception e)
		{ 
			e.printStackTrace();
			return IconCaches.getEmptyIcon();