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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:21:07+00:00 2026-06-09T22:21:07+00:00

Good day to everyone! I need to stop method execution until another activity will

  • 0

Good day to everyone!

I need to stop method execution until another activity will end.
At the moment I’m trying to do it in this way:

    private boolean isPausedWhileSplash;

public void showSplashWorldChangeAd(String oldWorldName, String newWorldName) {
    overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
    Intent intent = new Intent(this, SplashScreen.class);
    intent.putExtra(SplashScreen.MSG_STRING_KEY, oldWorldName + " -> "
            + newWorldName);
    intent.putExtra(SplashScreen.OLD_WORLD, oldWorldName);
    intent.putExtra(SplashScreen.NEW_WORLD, newWorldName);
    startActivityForResult(intent, RESULT_OK);
    isPausedWhileSplash = true;
    while (isPausedWhileSplash) {
    }
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    isPausedWhileSplash = false;
}

But it’s not working.

Can you help me?

Thanks!

UPD: Maybe there is any way to prevent view from drawing? Because all what I need right now is delay calling of methods, which will redraw view of this activity. Now I have the new world drawn before the splash screen, saying about the world change, is shown, which is not looking good.

  • 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-09T22:21:09+00:00Added an answer on June 9, 2026 at 10:21 pm

    I’m a little rushed for time so here’s a generic answer:

    public class MonitorObject{
    }
    
    public class MyWaitNotify{
    
      MonitorObject myMonitorObject = new MonitorObject(); //To be used for synch
    
      public void doWait(){
        synchronized(myMonitorObject){
          try{
            myMonitorObject.wait(); // Wait until the notify method is called by another thread
          } catch(InterruptedException e){...}
        }
      }
    
      public void doNotify(){ //Notify waiting threads that they can continue
        synchronized(myMonitorObject){
          myMonitorObject.notify();
        }
      }
    }
    

    I’ll come back and get you a working example this afternoon if you haven’t got a solution by then…

    This article should get you started

    EDIT: This article demonstrates other approaches, all of which should be an improvement on your current solution. It talks you through how to update the UI from events in different threads and the benefits/costs of the various solutions.

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

Sidebar

Related Questions

Good day everyone I need to execute command on linux machine this command is
Good day everyone. This problem was part of another one which it as been
Hi and good day everyone, as per above title, I was trying to handle
Good day everyone, this is one of those areas that is a little over
Good day everyone! I am trying to understand how buffer overflow works. Right now,
Good day, everyone. I need a compiled and ready-to-use Flash lib, which is able
Good day everyone. I'm trying to figure out a way to use multiple flags
Good day everyone, I'm an independent game developer who has, in the past, primarily
Good day everyone, I am building a page in ASP.NET, and using Master Pages
Good day everyone. I am working on a Firefox extension, and I want to

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.