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 6368309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:39:32+00:00 2026-05-25T00:39:32+00:00

I have an activity, which when starting (onCreate or onStart) needs to manipulate some

  • 0

I have an activity, which when starting (onCreate or onStart) needs to manipulate some views, and then maybe immediately starts another activity (a interstitial ad in its own activity).

There seems to be a problem with the order/concurrency: The ad activity is opened, and then the manipulated view R.id.productlist_filterbar from the previous activity is drawn on top of the interstitial ad activity.

(Simplified) code:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.productlist);

    // Do some init stuff ..

    // Manipulate the GUI
    findViewById(R.id.productlist_filterbar).setVisibility(View.VISIBLE);

    // If executed, then a new intent is fired in here to open the interstitial ad
    if (..we have an ad..) {            
        Intent i  = new Intent(this, AdViewActivity.class);
        i.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
        startActivity(i);               
        overridePendingTransition(R.anim.fadein, 0);            
    }

}

What happens when I call startActivity() while there are still pending GUI modifications?

And, what would be the best solution for this case?

Thanks for any help!

  • 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-05-25T00:39:33+00:00Added an answer on May 25, 2026 at 12:39 am

    I would have a flag set in onAttachedToWindow() callback and then check for this flag in onWindowFocusChanged() if set then start the ad activity and reset the flag.

    void onAttachedToWindow() {
        mFlag = true;
    }
    
    void onWindowFocusChanged(boolean hasFocus) {
         if (hasFocus && mFlag) {
            // start ad activity.
    
            mFlag = false;
         }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an activity which shows some List entries. When I click on a
I have a notification which should give me some parameters when opening an activity
I have created an activity which sends a number of notifications to status bar.
I have a couple of tables which are used to log user activity for
Say if I have a locationManager(LM) object in activity A, which is my main
I have Activity with ListView inside it and in the onCreate method of the
I want to create loading progress bar when my activity is starting. I have
I have a main activity with a number of buttons. Each button is starting
Actually in my application i have set an activity as main activity in which
For my app, I have about 15Mb (which can be compressed with some processing

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.