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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:08:49+00:00 2026-06-13T21:08:49+00:00

I’m working on a game using AndEngine, and I need to show the users

  • 0

I’m working on a game using AndEngine, and I need to show the users the list of his Facebook friends.
I’ve created my custom Adatper for the ListView and after the loading finishes everything works great.
I have a problem with the loading part it self.

The ListView is inside a custom dialog, So inside this dialog, I’m running an AsyncTask to fetch the friends’ info, in that AsyncTask I have a ProgressDialog. The problem is, the ProgressDialog shows up behind the dialog that contains the to-be list (which while loading, is just the title).
I can see the ProgressDialog “peeking” behind that dialog..
Any Ideas?

Here’s some code:

FriendsDialog.java

private ProgressDialog dialog;

//Constructor of the AsyncTask
public FriendsLoader(Context context) {
    dialog = new ProgressDialog(context);
    dialog.setMessage("Please wait..\nLoading Friends List.");
}

@Override
protected void onPreExecute() {
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    dialog.setView(inflater.inflate(R.layout.loading, null));
    dialog.setMessage("Please wait..\nLoading friends.");
    dialog.show();
}

@Override
protected void onPostExecute(ArrayList<HashMap<String, Object>> data) {
    if (dialog.isShowing()) {
        dialog.dismiss();
    }
    MyAdapter myAdapter = new MyAdapter(context, data);
    listView = (ListView) findViewById(R.id.list);
    listView.setAdapter(myAdapter);
    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> myAdapter, View myView, int myItemInt, long mylng) {
            String id = (String) listView.getItemAtPosition(myItemInt);
            listener.onUserSelected(id);
            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-13T21:08:51+00:00Added an answer on June 13, 2026 at 9:08 pm

    Opening a dialog from another dialog is not the best idea, especially if one of them is a progress dialog (try to rotate the screen..).

    I suggest a better approach:

    The friends dialog will have 2 views: ListView and a ProgressBar.
    The ListView will be invisible when you load the data, and the ProgressBar will be visible at the time. When you’ll finish loading the data, just switch the visibility between those 2 views.

    For a smoother transition between those views, you can use ViewAnimator, which takes care of the visibility modes and even allows you to add an effect to the transition (e.g. fade, slide etc.). It’s very simple to use and there are lots of examples online.

    Best of luck!

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

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I want to show the soap response to UIWebview.. my soap response is, <p><img

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.