content: package com.aidlmusicplayer.www.helper;
  
  import android.graphics.Bitmap;
  import android.graphics.BitmapFactory;
  
  import java.io.IOException;
  import java.io.InputStream;
  import java.net.HttpURLConnection;
  import java.net.MalformedURLException;
  import java.net.URL;
  
  /**
   * author：agxxxx on 2017/3/7 09:55
   * email：agxxxx@126.com
   * blog: http://www.jianshu.com/u/c1a3c4c943e5
   * github: https://github.com/agxxxx
   * Created by Administrator on 2017/3/7.
   */
  
  public class UIHelper {
      public static Bitmap decodeUriAsBitmapFromNet(String url) {
          URL fileUrl = null;
          Bitmap bitmap = null;
          try {
              fileUrl = new URL(url);
          } catch (MalformedURLException e) {
              e.printStackTrace();
          }
  
          try {
              HttpURLConnection conn = (HttpURLConnection) fileUrl
                      .openConnection();
              conn.setDoInput(true);
              conn.connect();
              InputStream is = conn.getInputStream();
              bitmap = BitmapFactory.decodeStream(is);
              is.close();
          } catch (IOException e) {
              e.printStackTrace();
          }
          return bitmap;
  
      }
  }
  