Code example for HttpURLConnection

Methods: getURL

0
    fetchTo(Client client)
    { 
    	this.client = client;
        // TODO: prevent starting twice 
        final Handler callingThread = new Handler();
        Thread reader = new Thread(connection.getURL().toString()) {
        	@Override public void run() { 
        		performFetch(callingThread);
        	} 
        }; 
        reader.start();
    } 
     
    /** 
     * Stop the loading.   
     * This should only be called from the same thread that called start(). 
    **/ 
    public void 
    cancel() 
    { 
        // TODO: figure out a way to implement cancel()