2

Upon tapping on "Learn More" text-link when a Video-Ad is played in the Android App, a default "Open With" dialog appears before the appropriate ClickThroughUrl is retrieved in the AdEvent.AdEventListener.onAdEvent(AdEvent adEvent) method and passed along to Custom Chrome Tabs.

Therefore, after closing the Custom Chrome Tabs, the dialog still remains.

Is there a way to customize the "Learn More" text-link so the Click-event goes straight to the AdEventListener rather than handling on it's own thereby showing the "Open With" dialog.

In other words, I don't want a "Open With" dialog when I click on "Learn More" text-link in a Video-Playback Android App while a Video-Ad is playing. Any pointers how to achieve that will be appreciated.

AndroidRocks
  • 292
  • 4
  • 16

1 Answers1

1

Well, you could theoretically extract the URL via reflection

try {
    Method method = ad.getClass().getDeclaredMethod("getClickThruUrl");
    Url clickUrl = (String) method.invoke(ad);
} catch (Exception e) {
    // Log or whatever
}

And then open a pre-selected browser yourself, maybe via an Intent that knows the package name of the one you have in mind?

But yeah... those are two pretty hacky things directly in a row, and they're both likely to break in future, when method names change, packages come and go, users have new browsers etc. So you'll have to think about this

avalancha
  • 1,457
  • 1
  • 22
  • 41