[IMA-SDK Android] An error occurs when trying to open the ad link in a custom tab

29 views
Skip to first unread message

pineapplevine1

unread,
Oct 21, 2025, 2:46:05 AM (2 days ago) Oct 21
to Interactive Media Ads SDK
Hi IMA Team

We are developing a library that customizes Media3 and wraps the IMA SDK APIs, so that the app invokes the IMA SDK APIs through the library’s API.
Currently, with that implementation, when we call setEnableCustomTabs(true)—an IMA SDK API—and try to open an ad’s landing page in a custom tab, we encounter an Intent-related error.

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

If you have any ideas about the cause of this issue or possible workarounds, please let us know.

Best Regards.

IMA SDK

unread,
Oct 21, 2025, 10:26:34 AM (2 days ago) Oct 21
to pineapp...@gmail.com, ima...@googlegroups.com

Hi,

Thank you for reaching out to the IMA SDK Support team.

The behavior you are experiencing when starting an Activity from a non-Activity context such as a Fragment is expected, as outlined in the documentation. You can try adding Intent.FLAG_ACTIVITY_NEW_TASK to your startActivity() call to see if that resolves the issue.Additionally, if you're using an older version of the SDK, we recommend updating to the latest version.

If the problem persists, please share the following details so we can investigate further.

  • Sample project reproducing the issue
  • Steps to replicate the issue
  • Affected device information

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=500Ht00001vRLwJIAW&entry.80707362=00336063

2. Fill out all fields, and attach your file(s).

3. Please reply back to this thread when you have uploaded your file(s). Please do not share this link.
Thanks,

 
Google Logo IMA SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-10-21 14:26:25Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01vRLwJ:ref" (ADR-00336063)



pineapplevine1

unread,
Oct 22, 2025, 5:39:33 AM (yesterday) Oct 22
to Interactive Media Ads SDK
Hi IMA Team

The startActivity() mentioned in the error message is not being called by our app or by our library that customizes Media3. We believe it is triggered by an Intent sent by the IMA SDK when the “Learn more” in the ad is tapped to open the link. Therefore, if FLAG_ACTIVITY_NEW_TASK is to be added, it would need to be handled within the IMA SDK’s processing.

Best Regards.

2025年10月21日火曜日 23:26:34 UTC+9 IMA SDK:

IMA SDK

unread,
Oct 22, 2025, 10:39:33 AM (19 hours ago) Oct 22
to pineapp...@gmail.com, ima...@googlegroups.com

Hi,

Thank you for getting back to us.

As mentioned earlier, could you please share the following details via reply to author option? This will help us continue our investigation.

    • Sample project reproducing the issue
    • VAST tag with learn more option
    • Affected device information
    If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

    1. Navigate to

    https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=500Ht00001vRLwJIAW&entry.80707362=00336063

    2. Fill out all fields, and attach your file(s).

    3. Please reply back to this thread when you have uploaded your file(s). Please do not share this link.

    Thanks,
     
    Google Logo IMA SDK Team

    Feedback
    How was our support today?

    rating1    rating2    rating3    rating4    rating5

    [2025-10-22 14:39:22Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01vRLwJ:ref" (ADR-00336063)



    Reply all
    Reply to author
    Forward
    0 new messages