开发者

How to dismiss the progress bar

In my app there is a button that onClick moves you to a new activity with rss news.

I want to use a progress b开发者_如何学Car until the news are downloaded to the device...

I have make some tries but unfortunately the progress bar is starting until the rss load,when they present it stops but when i return to the previous activity with the android back button, the progress bar starts again and never stops..

I have entered the progress bar in the onClick of the button in my first activity:

Button nea = (Button) findViewById(R.id.nea);
    nea.setOnClickListener(new View.OnClickListener() {
        public void onClick (View view) {


              Thread thread =  new Thread(null, null, "MagentoBackground");
                thread.start();
                m_ProgressDialog = ProgressDialog.show(main.this,    
                      "Please wait...", "Retrieving data ...", true);


            Intent myIntent = new Intent(view.getContext(), nea.class);
            startActivityForResult(myIntent, 0);


        }  

    });

Where should I put something like m_ProgressDialog.dismiss();


try out this way: how to open ProgressBar inside the alertDailog? or use Asynctask for that Issue with android layout and progressbar

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜