下面列出了android.app.ProgressDialog#STYLE_SPINNER 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
private void handleInteract(final InteractiveException e) {
if (currentTask != null) currentTask.cancel();
currentTask = new CancellableTask.BaseCancellableTask();
final ProgressDialog cfDialog = new ProgressDialog(this, ProgressDialog.STYLE_SPINNER);
cfDialog.setMessage(getString(R.string.error_interactive_dialog_format, e.getServiceName()));
cfDialog.setCanceledOnTouchOutside(false);
cfDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
if (currentTask != null) currentTask.cancel();
switchToErrorCaptcha(getString(R.string.error_interactive_cancelled_format, e.getServiceName()));
}
});
cfDialog.show();
Async.runAsync(new Runnable() {
@Override
public void run() {
e.handle(PostFormActivity.this, currentTask, new InteractiveException.Callback() {
@Override public void onSuccess() { cfDialog.dismiss(); send(); }
@Override public void onError(String message) { cfDialog.dismiss(); switchToErrorCaptcha(message); }
});
}
});
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_table_data);
mIvQuery = findView(R.id.iv_right);
mIvQuery.setVisibility(View.VISIBLE);
mIvQuery.setImageResource(R.drawable.ic_edit_sql);
mIvQuery.setOnClickListener(this);
Intent extraIntent = getIntent();
mTableName = extraIntent.getStringExtra(EXTRA_TABLE_NAME);
mDbPath = extraIntent.getStringExtra(EXTRA_DB_PATH);
mTables = findView(R.id.table);
mLayoutQuery = findView(R.id.layout_sql_query);
mEtSql = findView(R.id.et_raw_sql);
mBtnQuery = findView(R.id.btn_execute_sql);
mBtnQuery.setOnClickListener(this);
mTvError = findView(R.id.tv_sql_error);
enableBack();
setMainTitle(String.format("Data In %s", mTableName));
mDlgSelector = new SelectorDialog(this);
mDlgSelector.setSelectItems(SELECT_ITEMS, this);
mDlgLoading = new ProgressDialog(this,ProgressDialog.STYLE_SPINNER);
mDlgLoading.setMessage(getString(R.string.loading));
mDlgLoading.setCancelable(false);
mDlgLoading.setCanceledOnTouchOutside(false);
listTableData();
}
/**
* Prepare the progress dialog tho be shown setting the title and the message
*
* @param nodeName name of the node that we will use
*/
private void setUpProgressDialog(String nodeName) {
mConnectionWait = new ProgressDialog(getActivity(), ProgressDialog.STYLE_SPINNER);
mConnectionWait.setTitle(R.string.progressDialogConnTitle);
mConnectionWait.setMessage(String.format(getResources().getString(R.string
.progressDialogConnMsg),
nodeName));
}
private void setupDialog() {
dialog = new ProgressDialog(this,ProgressDialog.STYLE_SPINNER);
dialog.setTitle("Loading");
dialog.setMessage("Please wait...");
dialog.setIndeterminate(true);
dialog.show();
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
ProgressDialog progressDialog = new ProgressDialog(getActivity(), ProgressDialog.STYLE_SPINNER);
progressDialog.setMessage(getString(R.string.title_commenting));
progressDialog.setIndeterminate(true);
progressDialog.setCancelable(true);
return progressDialog;
}