Code example for ExecutionException

Methods: printStackTrace

0
		try { 
			return task.execute().get();
		} catch (InterruptedException e) {
			e.printStackTrace();
		} catch (ExecutionException e) {
			e.printStackTrace();
		} 
		return false; 
	} 
 
	private class IsOnlineTask extends AsyncTask<Void, Void, Boolean> {
 
		@Override 
		protected Boolean doInBackground(final Void... params) {
			try { 
				URL url = new URL("https://www.digipost.no");
				URLConnection connection = url.openConnection();
				connection.setConnectTimeout(3000);
				connection.connect();
				return true; 
			} catch (Exception e) {