I have a button in one page and when I click on that button I
am able to go another activity through Intent(), but onbuttonclick()
in which activity I am going in that activity data in spinner
coming from server means on button click
I load that data on spinner from server.so it takes times for moving my button click activity
to other activity so I want to show progress bar when my button is clicked
and untill data is not coming from server...how to achieve this..and I want to show progress bar
on buttonclick page means on my first activity when I click the button.
My code of of on button click is given below.
cuurentloc.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v) {
Intent i = new Intent(MainMenu.this, currentlocmap.class);
startActivity(i);
}
});
Actually I know asynchronous task but using this I will be able to show progress bar on 2nd activity, I want to show it on my first activity until data is not loaded in second activity, so I want progree bar above the button on first activity, and when data is loaded on second activity it moves to second.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…