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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:01:33+00:00 2026-06-15T14:01:33+00:00

I have a view with EditText , Button and ListView . Button’s onClick() parses

  • 0

I have a view with EditText, Button and ListView.
Button’s onClick() parses some site (this part works OK), but it takes some time to display the parsed info in ListView, so I want to display small ProgressBar on the place, where the ListView should take place after a while.

So, I add this to my layout (I write important part here):

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/layout1"
        android:weightSum="1.0">

        <EditText
            android:layout_width="0px"
            android:layout_height="wrap_content"
            android:layout_weight=".86" />

        <ImageButton
            android:layout_height="match_parent"
            android:layout_width="0px"
            android:layout_weight=".14" />

    </LinearLayout>

    <RelativeLayout 
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:layout_below="@id/layout1"
        android:gravity="center"
        android:layout_centerInParent="true"
        android:id="@+id/progressbar" >

        <ProgressBar 
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            style="@android:style/Widget.ProgressBar.Small" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/layout1">

        <ListView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />

    </RelativeLayout>

</RelativeLayout>

In source code:

progressBar = (RelativeLayout) findViewById(R.id.progressbar);

And everytime I want to show the ProgressBar, I do this:

progressBar.setVisibility(View.VISIBLE);

for disabling:

progressBar.setVisibility(View.INVISIBLE);

But this doesn’t work.

How can I work this out?

  • 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-15T14:01:34+00:00Added an answer on June 15, 2026 at 2:01 pm

    There’s no need to manipulate your ProgressBar‘s visibility. ListView has a feature called “empty view” which is shown only if your ListView is empty. Here’s what you need to do to use it:

    1. If your activity extends ListActivity, use
      android:id="@android:id/list" for your ListView and
      android:id="@android:id/empty" for your ProgressBar.
    2. If you don’t extend ListActivity, there’s a setEmptyView()
      method of your ListView, which lets you do the same thing.

    The above method fits best if you don’t need to empty your ListView (e.g. data is loaded only once, at the activity startup). If you need to set data after that, it is better to use ViewSwitcher, which also has great advantage – it lets you apply transition animation. For details on ViewSwitcher, take a look at this.

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

Sidebar

Related Questions

I have a list view, editText and button. editText and button are my footer
I have a custom listView with a textView, editText and a Button on a
I have ListView which is customized to have a EditText box and a Button
I want to add items to the listview underneath the edittext. This works perfectly.
I have a custom dialog with one editText view and two buttons ok and
i have view like 'home/details/5', it can be access by anonymous user. but there
i have view controller which contains a button which show the image library ,if
I have a simple linearlayout with a textbox a button and a listview, I'm
I have created a filter listview where user will enter input via edittext and
I have a a listview with each row having a text field and edittext

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.