Code example for ThreadPoolExecutor

Methods: submit

0
			URI getURI = new URI("https", serverURL, path, null);
			String getURL = getURI.toString();
			HttpGet httpget = new HttpGet(getURL);
			httpget.setHeader("X-Api-Key", apikey);
			httpget.setHeader("X-Api-Version", "1.0.0");
			threadpool.submit(new AsyncHttpRequest(httpclient, localContext, httpget, cache, getURL, responseHandler));
		} catch (URISyntaxException e) {
			e.printStackTrace();
		} 
	} 
	 
	// Encode all characters 
	private String encode(String s) {
		s = Uri.encode(s);
		s = s.replace("(", "%28");
	    s = s.replace(")", "%29");
	    s = s.replace("!", "%21");
	    s = s.replace("\'", "%27");
	    s = s.replace("*", "%2A");
		return s;
	}