Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
progress dialog nugget
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
You can’t perform that action at this time.