本文整理汇总了Java中android.app.ProgressDialog.setIndeterminate方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressDialog.setIndeterminate方法的具体用法?Java ProgressDialog.setIndeterminate怎么用?Java ProgressDialog.setIndeterminate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.ProgressDialog
的用法示例。
在下文中一共展示了ProgressDialog.setIndeterminate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPreExecute
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, getClass().getName());
wakeLock.acquire();
progressDialog = new ProgressDialog(context);
progressDialog.setIcon(R.mipmap.ic_launcher);
progressDialog.setTitle(R.string.app_name);
progressDialog.setMessage(context.getString(R.string.msg_downloading, url.toString()));
progressDialog.setIndeterminate(true);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setCancelable(true);
progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
DownloadTask.this.cancel(true);
}
});
progressDialog.show();
}
示例2: onCreate
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv = (TextView) findViewById(R.id.label);
handler = new Handler(getMainLooper());
progressDialog = new ProgressDialog(this);
progressDialog.setMessage("Downloading MP3...");
progressDialog.setIndeterminate(true);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setCancelable(true);
if(!requestPermissions()){
handleIntent();
}
}
示例3: openFileWithUI
import android.app.ProgressDialog; //导入方法依赖的package包/类
private void openFileWithUI(File inputFile) {
final Activity activity = this;
final ProgressDialog pd = new ProgressDialog(activity);
pd.setTitle(getString(R.string.reading_dialog_title));
pd.setMessage(getString(R.string.reading_dialog_text));
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
pd.setMax(100);
pd.setProgress(0);
pd.setIndeterminate(true);
pd.setCancelable(false);
pd.show();
new FileOpenThread(inputFile, this, (o, n) -> {
pd.setIndeterminate(false);
pd.setProgress(n);
}, pd::dismiss, bookOpeningResult -> {
if (bookOpeningResult != null) {
addNewBookToBooksList(bookOpeningResult);
}
}).start();
}
示例4: perfomLogin
import android.app.ProgressDialog; //导入方法依赖的package包/类
private void perfomLogin() {
if (!checkEmailAndPassword()) {
return;
}
final ProgressDialog progressDialog = new ProgressDialog(LoginActivity.this,
R.style.AppTheme_Dark_Dialog);
progressDialog.setIndeterminate(true);
progressDialog.setMessage(getResources().getString(R.string.loading));
progressDialog.show();
String email = mEmailNameEditText.getText().toString();
String password = mPasswordEditText.getText().toString();
//Simulate network process for 3 seconds
new android.os.Handler().postDelayed(
new Runnable() {
public void run() {
progressDialog.dismiss();
startMainActivity();
}
}, 3000);
}
示例5: WebServiceClient
import android.app.ProgressDialog; //导入方法依赖的package包/类
public WebServiceClient(Context context, WebServiceTaskListener<T> listener) {
mContext = context;
mListener = listener;
if (mContext == null || mListener == null) {
throw new IllegalArgumentException();
}
mProgressDialog = new ProgressDialog(mContext);
mProgressDialog.setMessage(mContext.getString(R.string.wsc_please_wait));
mProgressDialog.setIndeterminate(true);
mProgressDialog.setCancelable(true);
mProgressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dlgInterface) {
abortTaskIfRunning();
}
});
mHash = getAppSignatureHash(mContext);
}
示例6: onPreExecute
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
super.onPreExecute();
// hack to get theme applied (which is not automatically applied due to activity's Theme.NoDisplay
ContextThemeWrapper theme = new ContextThemeWrapper(InstallExtensionDialogActivity.this,
FDroidApp.getCurThemeResId());
progressDialog = new ProgressDialog(theme);
progressDialog.setMessage(getString(R.string.requesting_root_access_body));
progressDialog.setIndeterminate(true);
progressDialog.setCancelable(false);
progressDialog.show();
}
示例7: onCreateDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Log.d(TAG, "onCreateDialog");
mDialog = new ProgressDialog(getActivity());
mDialog.setIndeterminate(true);
mDialog.setCancelable(false);
mDialog.setMessage(getString(R.string.zipping_library_before_mailing));
mDialog.setButton(Dialog.BUTTON_NEGATIVE, getString(android.R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dismiss();
}
});
return mDialog;
}
示例8: getFeed
import android.app.ProgressDialog; //导入方法依赖的package包/类
private void getFeed(final String link) {
//等待对话框loading...
progressDialog = new ProgressDialog(InputRssLinkActivity.this);
progressDialog.setIndeterminate(false);//循环滚动
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setMessage("loading...");
progressDialog.setCancelable(false);//false不能取消显示,true可以取消显示
progressDialog.show();
//异步请求feed数据,并插入到数据库
new Thread(new Runnable() {
@Override
public void run() {
RssRequestByOkHttp rssRequestByOkHttp = new RssRequestByOkHttp(InputRssLinkActivity.this);
rssRequestByOkHttp.getRssFeed(link);
SystemClock.sleep(800);
String name = rssRequestByOkHttp.getRssName();
Message message = new Message();
message.obj = name;
handler.sendMessage(message);
}
}).start();
}
示例9: login
import android.app.ProgressDialog; //导入方法依赖的package包/类
public void login() {
Log.d(TAG, "Login");
if (!validate()) {
onLoginFailed();
return;
}
_loginButton.setEnabled(false);
final ProgressDialog progressDialog = new ProgressDialog(LoginActivity.this,
R.style.Theme_AppCompat_DayNight_Dialog_Alert);
progressDialog.setIndeterminate(true);
progressDialog.setMessage("Authenticating...");
progressDialog.show();
String email = _emailText.getText().toString();
String password = _passwordText.getText().toString();
// TODO: Implement your own authentication logic here.
new android.os.Handler().postDelayed(
new Runnable() {
public void run() {
// On complete call either onLoginSuccess or onLoginFailed
onLoginSuccess();
// onLoginFailed();
progressDialog.dismiss();
}
}, 3000);
}
示例10: onPreExecute
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
dialog = new ProgressDialog(mContext);
super.onPreExecute();
Log.i("SERC Log:", "Starting onPreExecute");
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage("Loading. Please wait...");
dialog.setIndeterminate(true);
dialog.setCanceledOnTouchOutside(false);
Log.i("SERC Log:", "Showing ProgressBar");
dialog.show();
}
示例11: onCreate
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Matrix.init(new CardFactory());
refreshLayout = (SwipeRefreshLayout) findViewById(R.id.refresh);
refreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light);
scroll = (ScrollView) findViewById(R.id.scroll);
dialog = new ProgressDialog(this, android.app.AlertDialog.THEME_HOLO_LIGHT);
dialog.setCancelable(false);
dialog.setIndeterminate(true);
refresh();
refreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
refresh();
}
}, 3000);
}
});
}
示例12: createAndShowWaitSpinner
import android.app.ProgressDialog; //导入方法依赖的package包/类
private static ProgressDialog createAndShowWaitSpinner(Context mContext)
{
ProgressDialog dialog = new ProgressDialog(mContext);
try {
dialog.show();
}
catch (WindowManager.BadTokenException e) {
}
dialog.setCancelable(false);
dialog.setIndeterminate(true);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog.setContentView(R.layout.wait_spinner);
return dialog;
}
示例13: onPreExecute
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
progressDialog = new ProgressDialog(context);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setCancelable(false);
progressDialog.setIndeterminate(false);
progressDialog.setTitle(R.string.trimmer__deleting);
progressDialog.setMessage(context.getString(R.string.trimmer__deleting_old_messages));
progressDialog.setMax(100);
progressDialog.show();
}
示例14: showWaitDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
/**
* Common method been created for showing wait progress bar
*
* @param title the title
* @param message the message
* @param context the context
*/
protected void showWaitDialog(String title, String message, Context context) {
closeWaitDialog();
mWaitDialog = new ProgressDialog(context); // this = YourActivity
mWaitDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
mWaitDialog.setMessage(message);
mWaitDialog.setIndeterminate(true);
mWaitDialog.setTitle(title);
mWaitDialog.setCancelable(false);
mWaitDialog.show();
}
示例15: onCreateDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
setCancelable(false);
ProgressDialog dialog = new ProgressDialog(getActivity());
dialog.setTitle(getString(R.string.wiping_profile_data_title));
dialog.setMessage(getString(R.string.wiping_profile_data_message));
dialog.setIndeterminate(true);
return dialog;
}