public void preloadRequest() { request = new PHPublisherContentRequest(this, placementTxt.getText().toString()); request.setOnPurchaseListener(this); request.preload(); preloaded = true; }
@Override public void onResume() { super.onResume(); if (PHPublisherContentRequest.didDismissContentWithin( 2000)) { // can actually be less than 2 seconds, all we want is enough time for onResume to // be called PHStringUtil.log("Resumed after displaying content"); return; } PHStringUtil.log("Resumed PHPublisherView regularly"); }
@Override public void startRequest() { super.startRequest(); // testing the badge PHNotificationView notifyView = new PHNotificationView(this, placementTxt.getText().toString()); notifyView.setBackgroundColor(0xFF020AFF); notifyView.refresh(); super.addMessage("Notification View: ", notifyView); if (!preloaded) { // pass ourselves as the delegate AND the context request = new PHPublisherContentRequest(this, placementTxt.getText().toString()); request.setOnPurchaseListener(this); } request.send(); preloaded = false; }