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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:20:11+00:00 2026-05-27T00:20:11+00:00

I have a ProgressBar. It works ok but I need to show the max

  • 0

I have a ProgressBar.
It works ok but I need to show the max value and the current value.
They are not there.

Do I need to change to a ProgressDialog?

Clarification:

I am showing a ProgressBar.
The bar comes up perfectly but I want the numbers to appear as well.
So, for example, it the max is 1000 the current point is 300 then I want 1000 to appear and the end of the bar and 300 to appear somewhere on the bar or just below it.

I am using this class as the List Adaptor for the filling of an ListView.
The line displayed depends on the type of data in the Array of “awards”.
When doing a ProgressBar it appears without the numbers.

Code:

private class AwardsAdapter extends ArrayAdapter <AwardItem>{


    private ArrayList<AwardItem> awards = new ArrayList<AwardItem>();

    public AwardsAdapter(Context context, int textViewResourceId, ArrayList<AwardItem> awards) {
        super(context, textViewResourceId,awards);
        this.awards = awards;
        // TODO Auto-generated constructor stub
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        if (v == null) {
            LayoutInflater vi = (LayoutInflater)AwardsActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.awards_row, parent, false);
        }
        AwardItem award = awards.get(position);
        ProgressBar pb = (ProgressBar) v.findViewById(R.id.pgbAwardProgress);

        if(award.award_type == PROGRESSIVE) {
            pb.setVisibility(View.VISIBLE);
            pb.setMax(award.requirement);
            pb.setProgress(award.current_amount);
            pb.setIndeterminate(false);

        } else {
            pb.setVisibility(View.GONE);
        }
        ((TextView) v.findViewById(R.id.tvwShortMessage)).
                      setText(MessageBuilder.buildMessage(AwardsActivity.this, award.award_text, 
                              Integer.valueOf(award.requirement).toString()));

        return v;
    }

}

Layout

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
 android:layout_width="fill_parent"
 android:layout_height="wrap_content">
<TextView android:id="@+id/tvwShortMessage"
android:typeface="sans"
android:textSize="14sp"
android:textStyle="italic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/tvwLongMessage"
android:typeface="sans"
android:textSize="14sp"
android:textStyle="italic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tvwShortMessage"/>
<LinearLayout 
android:layout_width="fill_parent"
android:layout_height="wrap_content"    
android:layout_marginBottom="15dp" 
android:layout_below="@id/tvwLongMessage">
<ProgressBar
android:id="@+id/pgbAwardProgress"
android:layout_width="fill_parent"
android:layout_height="wrap_content"    
style="?android:attr/progressBarStyleHorizontal"
android:layout_marginRight="5dp" 
android:layout_marginTop="5dp" 
android:layout_marginBottom="15dp" 
android:layout_alignParentTop="true"/>
</LinearLayout>
</RelativeLayout>

This is the final screen.
It is a list of a series of tasks and their progress so far.
Each “line” is a separate progressbar.

enter image description here

  • 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-27T00:20:12+00:00Added an answer on May 27, 2026 at 12:20 am

    Why dont you just add the text manually, it seems like a much simple approach, I placed it where ever I wanted here, but you can just change the layout to what your need are.

    Sorry if there are any mistakes in the code, I didnt run this.

    XML:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <TextView android:id="@+id/tvwShortMessage"
    android:typeface="sans"
    android:textSize="14sp"
    android:textStyle="italic"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
    <TextView android:id="@+id/tvwLongMessage"
    android:typeface="sans"
    android:textSize="14sp"
    android:textStyle="italic"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/tvwShortMessage"/>
    <LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"    
    android:layout_marginBottom="15dp" 
    android:layout_below="@id/tvwLongMessage">
    <ProgressBar
    android:id="@+id/pgbAwardProgress"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"    
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_marginRight="5dp" 
    android:layout_marginTop="5dp" 
    android:layout_marginBottom="15dp" 
    android:layout_alignParentTop="true"/>
    </LinearLayout>
    <TextView android:id="@+id/pgbAwardProgressText"
    android:typeface="sans"
    android:textSize="14sp"
    android:textStyle="italic"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/pgbAwardProgress"
    android:layout_alignParentRight="true"
    android:visibility="gone"/>
    </RelativeLayout>
    

    Class:

    private class AwardsAdapter extends ArrayAdapter <AwardItem>{
    
    
        private ArrayList<AwardItem> awards = new ArrayList<AwardItem>();
    
        public AwardsAdapter(Context context, int textViewResourceId, ArrayList<AwardItem> awards) {
            super(context, textViewResourceId,awards);
            this.awards = awards;
            // TODO Auto-generated constructor stub
        }
    
        public View getView(int position, View convertView, ViewGroup parent) {
            View v = convertView;
            if (v == null) {
                LayoutInflater vi = (LayoutInflater)AwardsActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                v = vi.inflate(R.layout.awards_row, parent, false);
            }
            AwardItem award = awards.get(position);
            ProgressBar pb = (ProgressBar) v.findViewById(R.id.pgbAwardProgress);
    
            if(award.award_type == PROGRESSIVE) {
                pb.setVisibility(View.VISIBLE);
                pb.setMax(award.requirement);
                pb.setProgress(award.current_amount);
                pb.setIndeterminate(false);
                TextView progressText = ((TextView) v.findViewById(R.id.pgbAwardProgressText));
                progressText.setVisibility(View.VISIBLE);
                progressText.setText(award.current_amount+"/"+award.requirement);
            } else {
                pb.setVisibility(View.GONE);
            }
            ((TextView) v.findViewById(R.id.tvwShortMessage)).
                          setText(MessageBuilder.buildMessage(AwardsActivity.this, award.award_text, 
                                  Integer.valueOf(award.requirement).toString()));
    
            return v;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For a few days a have some problem. I need to show simple ProgressBar
I have an image called 'progressbar.png'. Is there a way that I could crop
I am trying to use performance progressbar in a WP7 project but I have
I have the basic jQueryUI progress bar code here; <script> $(function() { $(#progressbar).progressbar({ value:
I have a program to process very large files. Now I need to show
Ok, So I want to display some attributes, but only if they have a
I have a progressBar using the ProgressBar class. Just doing this: progressBar = new
I have been playing around with the Silverlight progressbar a while and no matter
I have created a form on which two components are present, button and progressbar
I have a progessbar in an activity but the Async is in an external

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.