I have a button, which on pressed, executes the following code:
public void onClick(View v) {
// TODO Auto-generated method stub
//progressSpin.setVisibility(View.VISIBLE);
try {
data=new WebkioskExtractor().execute(username,password).get();
System.out.println("Data = "+data);
} catch (Exception e) {
// TODO Auto-geneorated catch block
e.printStackTrace();
}
//progressSpin.setVisibility(View.GONE);
}
as clear from the code, i have to wait for the AsyncTask to finish because i am relying on the data it returns. the problem is that while the task in being executed (it fetches some data from the internet) the button remains in the pressed state. even if i set the progressbar i created to VISIBLE, it does not show up.
How can i fix this? I would like the button to be pressed once and then the progressbar should start spinning, which isn't happening.