Code example for URL

Methods: openStream

0
    private void process(final String url, final int position) {
        new Thread() {
            @Override 
            public void run() { 
                try { 
                    InputStream is = new URL(url).openStream();
                    bitmap[position] = BitmapFactory.decodeStream(is);
                    is.close();
 
                    handler.post(new Runnable() {
                        public void run() { 
                            handler.sendEmptyMessage(position);
                        } 
                    }); 
                } catch (Exception e) {
 
                } 
            } 
        }.start();
    }