Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8188575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:57:35+00:00 2026-06-07T02:57:35+00:00

Can I load admob ad using AsyncTask ? I have tried it but I

  • 0

Can I load admob ad using AsyncTask ?

I have tried it but I get lots of warning at runtime and the ad is not loaded

one of the warning when I create new AdView instance is

07-06 09:57:31.170: W/webview(1113): java.lang.Throwable: Warning: A WebView method was called on thread 'AsyncTask #1'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.

my method looks like this

 @Override
protected AdView doInBackground(Activity... activityParam) 
{   
         Looper.prepare();              
         activity = activityParam[0];   
         // Create the adView
         AdView adView = new AdView(activity, AdSize.BANNER, "xxxxxxxxxxxxx");                  
         return adView;         
}

Please advise if this should at all be called on non UI thread, the only reason I am doing it to prevent UI blocking..

Edit.

May be I did not express my problem properly,

I am trying to load the ad in background because it seems to block for some seconds,
I do not want to block my activity’s interface.

read this post How to avoid Admob blocking the UI thread where it is recommended that to avoid UI blocking one should use AsyncTask

So what I want to know if is alternate to load an ad in the background.. ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:57:38+00:00Added an answer on June 7, 2026 at 2:57 am

    Separate out the time required to create the AdView which needs to be done on the UI thread and the time it takes to communicate to the ad server and deliver an ad. The ‘block’ or ‘lag’ is probably the Ad SDK’s thread trying to get an ad to show to you. As it has to do this over the internet it takes time for an ad to show up. I really don’t think AdMob would block the UI thread while trying to get an ad, however there will be a visible delay between when you see all of your UI widget items (buttons, textfields, images, etc.) shown on the screen of your activity and when the ad shows up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can load the Color contents of the Current Window using GetDIBits but i
I have an application that can load in third party code. One of the
ok so i can load a mesh perfectly but loading its texture is not
Apache Pig can load data from Hadoop sequence files using the PiggyBank SequenceFileLoader :
I have a web application that can load plugins through reflection. It currently uses
So I need a function to test if an image can load or not.
Can any one tell me how i can load my required iAds in to
Question: I have a dll that I can load in another program. Now the
We have a requirement that a user can load any standard image into a
I can load the fixture file in my django application by using loaddata: manage.py

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.