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

The Archive Base Latest Questions

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

All my listviews in my application are using the empty property to show a

  • 0

All my listviews in my application are using the empty property to show a progressdialog while loading some web content:

    <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:id="@android:id/empty" android:gravity="center">
                <ProgressBar android:id="@+id/progressBar1" android:layout_width="wrap_content" android:layout_height="wrap_content"></ProgressBar>
    </RelativeLayout>
    <ListView android:id="@android:id/list"
        android:layout_width="fill_parent" android:layout_height="wrap_content" />

This is great and work fine the first time, but unfortunately, if I want to reload the listview, I expect the progressdialog to show again!

but, I can use:

getListView().setAdapter(null);

or

getListView().setAdapter(new TweetItemAdapter(getActivity(),R.layout.row_tweet,new ArrayList<Tweet>())); 

I xon’t get any dialog, just an empty view.

So basically my question is “how to show the empty layout again during the second loading of the listview?

EDIT: With comment below, I tried :

    @Override
    public void onResume() {
        super.onResume();
        TweetItemAdapter test = (TweetItemAdapter) getListView().getAdapter();
        if(test != null){
            test.clear();
            test.notifyDataSetChanged();
        }
        loadTweets(this, getListView());
    }

Still doesn’t show the progressdialog, I get an empty view while loading. (EXCEPT for first loading that works perfectly)

  • 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:06:48+00:00Added an answer on May 25, 2026 at 12:06 am

    Approach: Add in you XML the view that you want to show up when the ListView is empty. Then when populating the ListView check for the length of the data supplier you use in you adapter inside the getView() method (if it is null or its length is 0) if it is null/0-length then instantiate that view and change its visibility to View.VISIBLE. Or use getListView().setEmptyView(findViewById(R.id.myemptyview));

    Remark: I think there is no need to clear you adapter test.clear() since (I assume somewhere in loadTweets() you have adapter and call notifyDataSetChanged() again) the listview will repopulate with the new data.

    Question: Do you reinstantiate the progress dialog whenever you call notifyDataSetChanged() because my logic says that: progress dialog must be shown whenever you do fetching, i.e repopulating the listview with data? (I might be wrong)

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

Sidebar

Related Questions

Hi am working on an android application. And am using a listview in some
I am developing an Android application using android sdk v 2.1. In one page
i am building an android application but i have some questions about the memory
I have just written a Word Document creation web application using .NET 3.5 which
Until now I'm using a SoftReference Cache for images in Android. This cache is
I'm using EventLog to support a logging class in my C# application. ( Previously...
I'm making an ecommerce application on Android and, as it is my first serious
how can i pause and resume in application while working with loops i can
I want to present some choices in my application. Right now I'm doing it
I am currently working on an Android tablet application which has two fragments, 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.