當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。