Java Code Examples for android.app.progressdialog#setMessage()

The following examples show how to use android.app.progressdialog#setMessage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainActivity.java    From your-local-weather with GNU General Public License v3.0 6 votes vote down vote up
private void detectLocation() {
    if (WidgetRefreshIconService.isRotationActive) {
        return;
    }
    mProgressDialog = new ProgressDialog(MainActivity.this);
    mProgressDialog.setMessage(getString(R.string.progressDialog_gps_locate));
    mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    mProgressDialog.setIndeterminate(true);
    mProgressDialog.setCancelable(false);
    mProgressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(android.R.string.cancel), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            try {
                dialog.dismiss();
            } catch (SecurityException e) {
                appendLog(MainActivity.this, TAG, "Cancellation error", e);
            }
        }
    });

    updateNetworkLocation();
    mProgressDialog.show();
    refreshDialogHandler = new Handler(Looper.getMainLooper());
}
 
Example 2
Source File: BaseActivity.java    From actor-platform with GNU Affero General Public License v3.0 6 votes vote down vote up
public <T> void execute(Command<T> cmd, int title) {
    final ProgressDialog progressDialog = new ProgressDialog(this);
    progressDialog.setMessage(getString(title));
    progressDialog.setCancelable(false);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.show();
    cmd.start(new CommandCallback<T>() {
        @Override
        public void onResult(T res) {
            dismissDialog(progressDialog);
        }

        @Override
        public void onError(Exception e) {
            dismissDialog(progressDialog);
        }
    });
}
 
Example 3
Source File: WelcomeActivity.java    From CoolWeather with Apache License 2.0 5 votes vote down vote up
private void showProgressDialog(String title)
{

	pDialog = new ProgressDialog(this);
	pDialog.setCancelable(false);
	pDialog.setMessage(title+"...");
	pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
	pDialog.show();
}
 
Example 4
Source File: Trimmer.java    From Silence with GNU General Public License v3.0 5 votes vote down vote up
@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();
}
 
Example 5
Source File: DiscoverDeviceActivity.java    From spark-setup-android with Apache License 2.0 5 votes vote down vote up
private void showProgressDialog() {
    wifiListFragment.stopAggroLoading();

    String msg = Phrase.from(this, R.string.connecting_to_soft_ap)
            .put("device_name", getString(R.string.device_name))
            .format().toString();

    connectToApSpinnerDialog = new ProgressDialog(this);
    connectToApSpinnerDialog.setMessage(msg);
    connectToApSpinnerDialog.setCancelable(false);
    connectToApSpinnerDialog.setIndeterminate(true);
    connectToApSpinnerDialog.show();
}
 
Example 6
Source File: OrderDetailActivity.java    From HomeApplianceMall with MIT License 5 votes vote down vote up
@Override
protected void onPreExecute() {
    super.onPreExecute();
    pd = new ProgressDialog(OrderDetailActivity.this);
    pd.setMessage("处理中...");
    if(!pd.isShowing()){
        pd.show();
    }
    pd.show();

}
 
Example 7
Source File: CopyProgressDialogFragment.java    From DocUIProxy-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final ProgressDialog dialog = new ProgressDialog(getActivity(), android.R.style.Theme_DeviceDefault_Dialog);
    dialog.setMessage(getString(R.string.copy_dialog_message));
    dialog.setCancelable(false);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setIndeterminate(true);
    dialog.setOnShowListener(this);
    return dialog;
}
 
Example 8
Source File: ProductsActivity.java    From android-paypal-example with Apache License 2.0 5 votes vote down vote up
private void buildProgressDialog(){
    pDialog = new ProgressDialog(this);
    pDialog.setCancelable(false);
    pDialog.setMessage("loading ...");
}
 
Example 9
Source File: AppBaseActivity.java    From AndroidNetwork with MIT License 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //初始化ProgressDialog
    final ProgressDialog dialog = new ProgressDialog(this);
    dialog.setMessage(getResources().getString(R.string.str_loading));
    dialog.setCanceledOnTouchOutside(false);
    dlg = dialog;
}
 
Example 10
Source File: CheckUpdateTask.java    From fingerpoetry-android with Apache License 2.0 5 votes vote down vote up
protected void onPreExecute() {
    if (mShowProgressDialog) {
        dialog = new ProgressDialog(mContext);
        dialog.setMessage(mContext.getString(R.string.android_auto_update_dialog_checking));
        dialog.show();
    }
}
 
Example 11
Source File: DeleteFileUtils.java    From Gallery-example with GNU General Public License v3.0 5 votes vote down vote up
protected void onPreExecute() {

            progressDialog = new ProgressDialog(activity);
            progressDialog.setMessage(activity.getString(R.string.deleting));
            progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
            progressDialog.setIndeterminate(true);
            progressDialog.setProgressNumberFormat(null);
            progressDialog.setProgressPercentFormat(null);
            progressDialog.setCancelable(false);
            progressDialog.show();
        }
 
Example 12
Source File: Utils.java    From LoveTalkClient with Apache License 2.0 5 votes vote down vote up
public static ProgressDialog showSpinnerDialog(Activity activity) {
	// activity = modifyDialogContext(activity);

	ProgressDialog dialog = new ProgressDialog(activity);
	dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
	dialog.setCancelable(true);
	dialog.setMessage("加载中...");
	if (activity.isFinishing() == false) {
		dialog.show();
	}
	return dialog;
}
 
Example 13
Source File: SettingsFragment.java    From IslamicLibraryAndroid with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onPreExecute() {
    dialog = new ProgressDialog(getActivity());
    dialog.setMessage(appContext.getString(R.string.prefs_copying_app_files));

    dialog.setCancelable(false);
    dialog.show();
}
 
Example 14
Source File: DisconnectingDialogFragment.java    From android with GNU General Public License v3.0 5 votes vote down vote up
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog dialog = new ProgressDialog(getActivity());
    dialog.setIndeterminate(true);
    dialog.setMessage(getString(R.string.disconnecting));
    setCancelable(false);
    return dialog;
}
 
Example 15
Source File: BaseFragment.java    From Instagram-Profile-Downloader with MIT License 5 votes vote down vote up
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    context = getContext();
    mProgressDialog = new ProgressDialog(context);
    mProgressDialog.setMessage("Loading,Please wait...");
    mProgressDialog.setTitle("Loading");
    mProgressDialog.setCancelable(false);
    mProgressDialog.setCanceledOnTouchOutside(false);


}
 
Example 16
Source File: MainActivity.java    From GeneratePicture with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    setContentView(R.layout.activity_main);
    webView = (WebView) findViewById(R.id.webView);
    edt = (EditText) findViewById(R.id.edt);
    btn_getData = (Button) findViewById(R.id.btn_getData);
    pd = new ProgressDialog(this);
    pd.setMessage("请稍后...");
    edt.setText(path);
    pd.show();

    initWebView();
}
 
Example 17
Source File: MainActivity.java    From CoolWeather with Apache License 2.0 5 votes vote down vote up
@Override
public void showDialog() {
	pDialog = new ProgressDialog(MainActivity.this);
	pDialog.setCancelable(true);// 点击可以取消Dialog的展现
	pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
	pDialog.setMessage("正在更新...");
	pDialog.show();
}
 
Example 18
Source File: MainActivity.java    From OpenAlprDroidApp with GNU Affero General Public License v3.0 4 votes vote down vote up
private void prepareProgressDialog(){
    progressDialog = new ProgressDialog(this);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.setMessage("Processing Image data");
    progressDialog.show();
}
 
Example 19
Source File: WUI.java    From WhereYouGo with GNU General Public License v3.0 4 votes vote down vote up
public static void startProgressDialog() {
    progressDialog = new ProgressDialog(A.getMain());
    progressDialog.setMessage(Locale.getString(R.string.loading));
    progressDialog.show();
}
 
Example 20
Source File: UserActivity.java    From NewAndroidTwitter with Apache License 2.0 3 votes vote down vote up
private void updateStatus(String status) {
	final ProgressDialog progressDlg = new ProgressDialog(this);
	
	progressDlg.setMessage("Sending...");
	progressDlg.setCancelable(false);
	
	progressDlg.show();
	
	TwitterRequest request 		= new TwitterRequest(mTwitter.getConsumer(), mTwitter.getAccessToken());
	
	String updateStatusUrl		= "https://api.twitter.com/1.1/statuses/update.json";
	
	List<NameValuePair> params 	= new ArrayList<NameValuePair>(1);
	
	params.add(new BasicNameValuePair("status", status));
	
	request.createRequest("POST", updateStatusUrl, params, new TwitterRequest.RequestListener() {
		
		@Override
		public void onSuccess(String response) {
			progressDlg.dismiss();
			
			showToast(response);
			
			Debug.i(response);
		}
		
		@Override
		public void onError(String error) {
			showToast(error);
			
			progressDlg.dismiss();
		}
	});
}