¿Cuál es la diferencia entre onPresentScreen y onLeaveApplication?

In the Admob SDK, there exists an interface called AdListener, documented below.

public interface AdListener {
  public void onReceiveAd(Ad ad);
  public void onFailedToReceiveAd(Ad ad, AdRequest.ErrorCode error);
  public void onPresentScreen(Ad ad);
  public void onDismissScreen(Ad ad);
  public void onLeaveApplication(Ad ad);
}

I'm trying to do something if the user clicks on an ad. I believe there are two fields which occur if a user clicks on an ad, namely the onPresentScreen() y onLeaveApplication(). Is this correct, and is there any difference between the two?

preguntado el 10 de marzo de 12 a las 00:03

1 Respuestas

onLeaveApplication() gets fired when the ad is causing the device to switch to a different application, such as a web browser when the ad is clicked.

onPresentScreen() gets fired when the ad renders something that is full screen.

In the likely case of the ad rendering a web browser or market, both of these callbacks get fired after clicking the ad. But theoretically, clicking the ad could render a new activity within your application, in which case onPresentScreen() gets fired but onLeaveApplication() no.

The above corner case may be particular for those using DoubleClick for Publishers and have more control over the ad inventory they serve - a live AdMob ad wouldn't load a new activity within your application.

respondido 10 mar '12, 02:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.