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

  • SEARCH
  • Home
  • 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 8551303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:10:02+00:00 2026-06-11T14:10:02+00:00

I rework my application for Android ICS and encountered the following problem. Ads are

  • 0

I rework my application for Android ICS and encountered the following problem. Ads are downloaded in oncreate in main thread, so the article (which is displayed by the webview) does not appear until the ads will not load.
How to load ads in new thread?

Here is the code of WebView Activity:

@Override
    public void onCreate(Bundle savedInstanceState) {
        setTheme(R.style.Theme_Sherlock_Light);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_webview);
        showActionBar();

    adView = (AdView) findViewById(R.id.adView);
    adView.setAdListener(this);
....
}
....
@Override
    public void onDismissScreen(Ad arg0) {
    }

    @Override
    public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
        ads_view.setVisibility(View.GONE);
    }

    @Override
    public void onLeaveApplication(Ad arg0) {
    }

    @Override
    public void onPresentScreen(Ad arg0) {
    }

    @Override
    public void onReceiveAd(Ad arg0) {
        ads_view.setVisibility(View.VISIBLE);
    }

Also I put adView block in RelativeLayout with id “ads_view”.

This method doesn’t work:

adView = (AdView) findViewById(R.id.adView);
        adView.setAdListener(this);

        (new Thread() {
            public void run() {
                 Looper.prepare();
                adView.loadAd(new AdRequest());
            }
        }).start();

Help, please.

  • 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-11T14:10:03+00:00Added an answer on June 11, 2026 at 2:10 pm

    The loadAd call needs to happen on the UI thread, because the SDK will eventually be adding the to your view hierarchy.

    Does your application have a WebView that is not displaying until an ad is received? What does your layout look like? Are you by any chance setting the article’s view to NONE until you get an ad?

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

Sidebar

Related Questions

I'm must build the same application for android and iphone. I tryed rhodes, that
We have a web application in which the users perform ad-hoc queries based on
Background: I'm working on an application that already has a thread system designed. It's
We have an iPad/iPhone enabled web application which was working good on iOS 5.1
REWORK FOR REOPEN: How can I have access to Windows Explorer FTP programmatically via
We are attempting to rework the SQL in a product. The product stores XML
We are a few months into a green-field project to rework the Logic and
So today I've learned that BouncyCastle is the default RSA Encryption Provider on Android
I've got a C# winforms application that runs in the background, listening for hotkeys
I've had the opportunity to rework a good deal of old, poorly maintained perl

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.