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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:41:36+00:00 2026-06-11T09:41:36+00:00

I have a bit of a strange problem. When an activity starts, I show

  • 0

I have a bit of a strange problem. When an activity starts, I show a dialog saying that some items are loading like this:

Dialog dialog;

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

    dialog = new Dialog (this);

    dialog.setContentView(R.layout.please_wait);
    dialog.setTitle("Loading The Comment.");

    TextView text = (TextView) dialog.findViewById(R.id.please_wait_text);
    text.setText("Please wait while the comment loads...");
    dialog.show();

I declare Dialog dialog right before the class declaration, and then whenever I try to dismiss it with dialog.dismiss(); it doesn’t close.

Here is the please_wait.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

<TextView
    android:id="@+id/please_wait_text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
</RelativeLayout>

Would someone know why the dialog does not close on dialog.dismiss()… I try the dismiss in an async call after the call returns. But I did check, and the line dialog.dismiss() is executed, just for some reason does not close the dialog.

This is how I try to dismiss the dialog:

@Override
protected void onPostExecute(String result) 
{
    dialog.dismiss();
} 
  • 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-11T09:41:37+00:00Added an answer on June 11, 2026 at 9:41 am

    Make sure that when you are executing dialog.dismiss that it is pointing to the dialog you created. You have dialog as a class variable and there is a high chance it was assigned another dialog by the time of dismissal come. I had this one and turned out that dialog variable at dismiss time was no longer pointing to my actually dialog.

    Putting a break point and seeing if the dialog variable upon creation/execution is still the same will probably help

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

Sidebar

Related Questions

I have a bit of strange problem on this page: http://www.bluprintliving.com/locations it seems that
I have a bit of a strange problem. I have a music app that
I have a bit of a strange problem. I have a controller that is
I have a bit of a strange problem with MySQL that I've never seen
I have a bit of a strange problem. I am trying to send in-app
I have a feeling my problem is a bit strange, but here goes... I
Right, bit of a strange question; I have been doing some linq to XML
Strange Question i guess but i have this bit of code in my page...
So I have run into a bit of a strange problem and can not
I'm a bit newbie to Flash, and I'm experiencing strange problem. I have a

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.