[Android] SDK crashes app while opening ads

66 views
Skip to first unread message

Ricardo Moutinho

unread,
Apr 9, 2015, 12:32:37 PM4/9/15
to ima...@googlegroups.com
When an AdsLoader is created using a non-activity context, clicking the video ad or any of its companion ads crashes the app because the SDK tries to open the ad's web view without setting the new task flag:

android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

The SDK should check if the provided context is indeed an Activity, and if not, it should add the FLAG_ACTIVITY_NEW_TASK flag to the startActivity call. 

The reason for loading ads with a non-activity context is simple: we're making the ad requests in a background manager that will start an activity to show the ads only when they're available.

Yury Pavlotsky (IMA SDK Team)

unread,
Apr 9, 2015, 3:47:00 PM4/9/15
to ima...@googlegroups.com
Hi Ricardo,

Thanks for your suggestion, I've let the rest of the team know, and we'll look into adding this.

Thanks,
Yury Pavlotsky
IMA SDK Team

Ricardo Moutinho

unread,
May 3, 2015, 3:31:19 PM5/3/15
to ima...@googlegroups.com
Hi Yury,

Any update on this topic? Have you reached any consensus? It's frustating having to make a new request to show the ad with a different context, even more since that request will sometimes fail leaving the app with a very poor user experience..

Regards,
Ricardo

Elton Kent

unread,
May 4, 2015, 3:12:55 PM5/4/15
to ima...@googlegroups.com
Hello Ricardo,
The team is looking into this. I will get back to you when i hear from them.

Thanks,
Elton

Ricardo Moutinho

unread,
Aug 27, 2015, 9:01:35 AM8/27/15
to Interactive Media Ads SDK
It's been a couple of months..Any update on this issue?

Regards,
Ricardo M.

Vu Chau (IMA SDK Team)

unread,
Aug 27, 2015, 11:18:33 AM8/27/15
to Interactive Media Ads SDK
Hi Ricardo,

The bug should have been fixed in the newest release (3.b12.1).  Could you give that a try and let us know if you still experience it?

Thanks,

Vu Chau
IMA SDK Team

Ricardo Moutinho

unread,
Sep 8, 2015, 12:43:23 PM9/8/15
to Interactive Media Ads SDK
Hi Chau,

I can confirm that I can no longer reproduce this issue with the latest release.

Thanks,
Ricardo M.
Reply all
Reply to author
Forward
0 new messages