网络获取bitmap

刷新adaptergridAdapter.notifyDataSetChanged();
通过地址获取bigmap

URL url=new URL("路径");
            HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
            urlConnection.setDoInput(true);
            urlConnection.setConnectTimeout(6*1000);
            urlConnection.connect();
            InputStream inputStream = urlConnection.getInputStream();
            //用bitmap名字获取bitmap
            Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
            inputStream.close();
            return bitmap;

你可能感兴趣的