public static void fetchAd(final Context context) {
		final Activity activity = (Activity) context;
		
		// Only do this if we haven't already got an ad preloading or loading
		if (adState != AdState.NONE){
			return;
		}


		setAdStateToLoading();

		activity.runOnUiThread(new Runnable(){
			@Override
			public void run(){
				currentOverlay = new AdOverlay(context);
				SDKRestClient.get(context, "http://ads.heyzap.com/in_game_api/ads/fetch_ad", new SDKResponseHandler() {
					@Override
					public void onSuccess(final JSONObject response) {
						if (adState != AdState.LOADING) {
							Log.e("heyzap-sdk-ads", "dropped response because ad state was: " + adState);
							return;
						}
						
						try {
							if (response.isNull("ad_html")) {
								// Go no ad to show
								setAdStateToNone();
								return;
							}

							// Get the ad to display
							// from the server
							String adHTML = (String) response.get("ad_html");
							String strategy = (String) response.get("ad_strategy");
							String promotedGamePackage = ((String) response.get("promoted_game_package"));
							currentImpressionId = (String) response.get("impression_id");

							currentOverlay.update(strategy, promotedGamePackage, adHTML);
							currentOverlay.setClickUrl(response.optString("click_url"));

							if(safeDismissProgressDialog()){
								currentOverlay.show();
							}

							setAdStateToLoaded();

						} catch (JSONException e) {
							e.printStackTrace();

							if (adState == AdState.LOADING) {
								safeDismissProgressDialog();
								setAdStateToNone();
							}
						}
					}

					@Override
					public void onFailure(final Throwable e) {
						e.printStackTrace();
						if (adState == AdState.LOADING) {
							safeDismissProgressDialog();
							setAdStateToNone();
						}
					}
				});
			}
		});
	}