Created
April 17, 2014 15:44
-
-
Save dvas0004/10993182 to your computer and use it in GitHub Desktop.
progress dialog nugget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uploadButton.setOnClickListener(new Button.OnClickListener() { | |
public void onClick(View v) | |
{ | |
final ProgressDialog progressDialog = new ProgressDialog(getActivity()); | |
//perform upload action | |
Thread thread = new Thread() | |
{ | |
@Override | |
public void run() { | |
getActivity().runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
progressDialog.setTitle("File Upload"); | |
progressDialog.setMessage("Please Wait..."); | |
progressDialog.isIndeterminate(); | |
progressDialog.show(); | |
} | |
}); | |
uploadFile(); | |
getActivity().runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
progressDialog.dismiss(); | |
} | |
}); | |
} | |
}; | |
thread.start(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment