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

  • Home
  • SEARCH
  • 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 8171481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:28:24+00:00 2026-06-06T21:28:24+00:00

I have a progress bar which I create in code my activity. This is

  • 0

I have a progress bar which I create in code my activity.
This is code:

progressDialog = new ProgressDialog(this); 
// Progress bar message.
String progressBarMessage = "Loading, please wait...";
progressDialog.getWindow().setGravity(Gravity.BOTTOM);

progressDialog.setCancelable(false);
progressDialog.setMessage(progressBarMessage);
// set the progress to be horizontal
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
// reset the bar to the default value of 0
progressDialog.setProgress(0);
// convert the text value to a integer
int maximum = 100;
// set the maximum value
progressDialog.setMax(maximum);
// display the progressbar
progressDialog.show();  

As you can see position my progressbar is bottom. How I can change position this progressbar to 3/4 of my page? I want to move that position will be between center and bottom? Maybe can I setMarginTop, but how?

  • 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-06T21:28:26+00:00Added an answer on June 6, 2026 at 9:28 pm

    Try something like this:

    // ...
    progressDialog.getWindow().setGravity(Gravity.CENTER);
    WindowManager.LayoutParams wmlp = progressDialog.getWindow().getAttributes();
    wmlp.y = height / 4;
    progressDialog.getWindow().setAttributes(wmlp);
    progressDialog.setCancelable(false);
    // ...
    

    Where height is an int value(the height of the screen) that you initialize in the onCreate method like this:

    height = getResources().getDisplayMetrics().heightPixels;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create loading progress bar when my activity is starting. I have
I have created a website loading progress bar using Jquery UI Progress bar. This
I have created an activity in which I have created a progress bar as
I have this code which works well: Public Function LoadBinaryFile(strFilename As String) As Byte()
I have a progress bar which inherits from JSlider to provide highlighting functionality. Highlights
I have a for-loop which is setting the value of the progress bar on
I have a progress bar to show the status of the program loading songs
I have to create a progress bar in a webapp. I need a thread
I have the basic jQueryUI progress bar code here; <script> $(function() { $(#progressbar).progressbar({ value:
I have created a C# COM DLL which is essentially an enhanced progress bar

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.