当前位置: 首页>>代码示例>>Java>>正文


Java ProgressDialog.setIndeterminate方法代码示例

本文整理汇总了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();
}
 
开发者ID:miankai,项目名称:MKAPP,代码行数:22,代码来源:DownloadTask.java

示例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();
    }
}
 
开发者ID:bornabesic,项目名称:yt-mp3-downloader-android,代码行数:19,代码来源:MainActivity.java

示例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();

}
 
开发者ID:pashkobohdan,项目名称:FastReading,代码行数:23,代码来源:AllBooks.java

示例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);
}
 
开发者ID:gokhanoguz,项目名称:MaterialDesignLogin,代码行数:24,代码来源:LoginActivity.java

示例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);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:21,代码来源:WebServiceClient.java

示例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();
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:15,代码来源:InstallExtensionDialogActivity.java

示例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;
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:16,代码来源:DebugDbExportDialogFragment.java

示例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();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:28,代码来源:InputRssLinkActivity.java

示例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);
}
 
开发者ID:paramsingh,项目名称:marauders,代码行数:32,代码来源:LoginActivity.java

示例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();

}
 
开发者ID:minigridems,项目名称:SERC-ENERYGY-METERING-MOBILE-APP,代码行数:14,代码来源:EmonCmsApiCall.java

示例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);

        }
    });

}
 
开发者ID:seasonfif,项目名称:matrix,代码行数:32,代码来源:MainActivity.java

示例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;
}
 
开发者ID:ArtifexSoftware,项目名称:mupdf-android-viewer-nui,代码行数:15,代码来源:ProofActivity.java

示例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();
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:12,代码来源:Trimmer.java

示例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();

}
 
开发者ID:Welloculus,项目名称:MobileAppForPatient,代码行数:20,代码来源:BaseActivity.java

示例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;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:10,代码来源:AccountManagementFragment.java


注:本文中的android.app.ProgressDialog.setIndeterminate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。