loadAds is blocking main thread

291 views
Skip to first unread message

luckyhan studio

unread,
Feb 20, 2020, 8:37:02 PM2/20/20
to Google Mobile Ads SDK Developers
I have a recyclerview. and when recyclerview's adapter is constructed, I try to load nativeAd from loadAds(context, 5) ( trying to load 5 ads )
but, if I do like that, main thread is blocked at the moment. I can't scroll smoothly at first time ( during loading ads )

how should I do to avoid this blocking problem?

I tried to call loadAds in asynctask. but it is not solved...

Mobile Ads SDK Forum Advisor Prod

unread,
Feb 21, 2020, 2:43:30 AM2/21/20
to luckyh...@gmail.com, google-adm...@googlegroups.com
Hi there,

Thank you for reaching out to us.

With regard to your concern, kindly note that it is an expected behavior of the SDK that the main thread is blocked at the moment (as you also mentioned), due to the creative assets being loaded into your app. In addition, the SDK just requests an ad to an ad-server (AdMob, Ad Manager, AdX, etc.) and doesn't have any control on what ads will be served into your app. 

As an aside, the SDK requires to make all calls on the main thread.

Regards,
Teejay Pimentel
Mobile Ads SDK Team

ref:_00D1U1174p._5001UV1mi3:ref
Reply all
Reply to author
Forward
0 new messages