tags:

views:

8446

answers:

4

I want to show my progressbar in the center of the screen when a processing happens on a button click. But I just want the progressbar without the dialog box..

Is there any way I can do this?

+5  A: 

It's explained in full in ApiDemos inside the SDK. The example that you want is named: ProgressBar3.java and can be found in \ApiDemos\src\com\example\android\apis\view\

Also, if you want to remove the borders of the dialog so that only the progress bar appears you can define the dialog itself as a transparent view/overlay (it's explained in the examples as well).

Reflog
A: 

Thanks a lot. I will take a look at it

Lynnooi
@Lynnooi: This is not an answer. Please do not make comments until you have earned the reputation to do so (you can make comments on your own questions and answers though).
Casebash
+1  A: 

@reflog: That's not what is needed I guess.

@lostInTransit:

The correct way to achieve this is as follows:

  1. Create ur own dialog
  2. Put progress bar as only view on the dialog
  3. Set dialog window background transparent
  4. Show the dialog.

That's it. It works for me on devices with 1.5 to 2.1. Not tried on 2.2.

-Yogesh

Yogesh
+1  A: 

There is a great example to do what Yogesh is suggesting at: http://efreedom.com/Question/1-3225889/Center-Progress-Indicator-ProgressDialog-Easily-Title-Text-Passed-Along

Credit goes to Macarse for posting it.

Hope this helps

WhoDatSaint