Code example for UnsupportedEncodingException

Methods: toString

0
		// Build a search request parameters 
		String encodedQuery = "";
		try { 
			encodedQuery = URLEncoder.encode(query, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			TLog.e(LOG_NAME, e.toString());
		} 
 
		// Build full URL string 
		final int pageNr = (startAt - 1) / 30; // 30 results per page, startAt is 1-based (not 0-based)
		final String url = String.format(QUERYURL, encodedQuery, String.valueOf(pageNr), (settings.getSortBySeeders()? SORT_SEEDS: SORT_COMPOSITE));
		 
		// Start asynchronous search 
		TLog.d(LOG_NAME, "Make GET request to The Pirate Bay on " + url);
		 
		final Handler handler = new Handler() {
			@SuppressWarnings("unchecked") 
			@Override 
            public void handleMessage(Message msg) {
				if (msg.what == -1) {
					callback.onSearchError(ThePirateBayAdapter.this, (SearchException) msg.obj);