tags:

views:

148

answers:

2

Hai dudes, Cany anyone tell me how to Create a ProgressDialog in Android?

+6  A: 

Come on try to think first! http://developer.android.com/guide/topics/ui/dialogs.html#ProgressDialog

WarrenFaith
@Mr.Warren Faith: Actually i tried this but that code not working for me the code is ProgressDialog dialog = ProgressDialog.show(MyActivity.this, "","Loading. Please wait...", true);
Tilsan The Fighter
than you should specify your question, tell us what you have programmed and what happens, what kind of error you got... you are a user registered 28 days ago, you asked 20 questions and still don't know how to ask a good specific question... don't forget, the answers will be only as good as the question is...
WarrenFaith
@Mr.Warren Faith :It runs eventhough the page is loaded ,similar like a infinite loop
Tilsan The Fighter
I guess you never call `dismiss`... thats why it will never disappear... also I stop here, because you simply dont understand how this works... try again with a better question...
WarrenFaith
+2  A: 

See the below code if this helps you..

     //progress bar

    final ProgressDialog progress_dialog = new ProgressDialog(DialogboxExample.this);
    progress_dialog.setMessage("Loading please wait..");
    progress_dialog.setCancelable(true);

    Button btnprogress = (Button) findViewById(R.id.button3);
    btnprogress.setOnClickListener(new OnClickListener(){
        public void onClick(View v)
        {
            progress_dialog.show();
        }
    });


    //progress bar percentage wise

    final ProgressDialog progress_dialog2;
    progress_dialog2 = new ProgressDialog(this);
    progress_dialog2.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progress_dialog2.setMessage("Loeading..");
    progress_dialog2.incrementProgressBy(10);
    //progress_dialog2.setProgress(100);
    progress_dialog2.setCancelable(true);

    Button btnprogress2 = (Button) findViewById(R.id.button4);
    btnprogress2.setOnClickListener(new OnClickListener(){
        public void onClick(View v)
        { progress_dialog2.show();}
    });
krunal shah
@Mr.krunal shah: can u pls tell me how to change that loading symbol of daisy wheel to some other symbol
Tilsan The Fighter
@Ganesh Sorry but i dont know how to change loading symbol
krunal shah
@krunal Shah: No problems thanks for ur replay.
Tilsan The Fighter
@Ganesh You are welcome
krunal shah
Tilsan The Fighter