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

The Archive Base Latest Questions

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

I have an Activity called MyProgressDialog which contains a ProgressDialog. This ScreenProgressDialog activity is

  • 0

I have an Activity called MyProgressDialog which contains a ProgressDialog. This ScreenProgressDialog activity is called in the Main activity by intents:

       if(msg.what == SET_PROGRESS){

            intent.putExtra("action", "set");
            ...

            intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);

            startActivity(intent);
        }
        else if(msg.what == SHOW_PROGRESS){             


            intent.putExtra("action", "show");
            ...

            intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);

            startActivity(intent);              
        }
        else if(msg.what == HIDE_PROGRESS){

            intent.putExtra("action", "hide");

            intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);

            startActivity(intent);

        }

Here is the MyProgressDialog activity:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Log.e("screenPD", "spd created");

    extras = getIntent().getExtras();



    pd = new ProgressDialog(this);

    ...setting the pd...        

    pd.show();  

    Log.e("screenPD", "spd shown");
}

@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);

    setIntent(intent);

    int newTitle = intent.getExtras().getInt("title");

    if (intent.getExtras().getString("action").equals("set")){
        pd.set methods...
        pd.show();

        Log.e("DialogSET", "DialogSET "+intent.getExtras().getInt("progress"));
    }
    else if (intent.getExtras().getString("action").equals("show")){
        pd.set methods...
        pd.show();

        Log.e("DialogSHOW", "DialogSHOW "+progress);

    }
    else if (intent.getExtras().getString("action").equals("hide")){
        pd.dismiss();
        this.finish();
        Log.e("DialogHIDE", "DialogHIDE");
        return;
    }
}

@Override
public void onDestroy() {
    super.onDestroy();
    Log.e("screenPD", "destroyed");     
}

And here is the LogCat:

DialogHIDE(2615): DialogHIDE
screenPD(2615): spd created
screenPD(2615): spd shown
screenPD(2615): destroyed

So the 3rd intent starts, calls the finish(); return; and the Onreate method is started which displays a new ProgressDialog. The onDestroy is called, but the ProgressDialog doesn’t hide from the screen. After the finish() method the activity shold be closed. Where is the problem? Thank you!

  • 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-07T14:02:13+00:00Added an answer on June 7, 2026 at 2:02 pm

    There is no error. the method invoking finish() will run out to completion and after its completion the controll returns to Android

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

Sidebar

Related Questions

I have an Android app which includes an activity called Help This uses a
I have a Activity called main. If I call Toast.makeText(this, Hello World from main,
I have main activity which call other object, for example GPS class. This GPS
I have an activity which gets called by 2 intents, one after a simple
i have a main Activity called Main which has onActivityResult Method. protected void onActivityResult(int
On my Android project I have the main Activity called TestFIO , which is
I currently have a class called clientActivity that contains a finger paintig activity that
I have this menu example But in this example new activity is not called,
I have this code: package com.problemio; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View;
I have an activity called message.java which is bound to the service GPS.java. The

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.