Code example for URL

Methods: openStream

0
 
    public void run() { 
        boolean succeeded = false;
 
        try { 
            URL url = new URL(tile.getUrl());
 
            tile.setBitmap(BitmapFactory.decodeStream(url.openStream()));
 
            recipientCache.add(tile);
            succeeded = true;
        } 
        catch (Exception e) {
            Log.e("Mapdroid BitmapDownloader", e.getMessage());
        } 
        finally { 
            try { 
                Message response = buildNotification(tile, succeeded);
                recipientMessenger.send(response);
            } 
            catch (android.os.RemoteException e) {