Esempio n. 1
0
  private void showMapWithLocationClient() {
    progressDialog = new ProgressDialog(this);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    progressDialog.setMessage("正在确定你的位置...");

    progressDialog.setOnCancelListener(
        new OnCancelListener() {

          public void onCancel(DialogInterface arg0) {
            if (progressDialog.isShowing()) {
              progressDialog.dismiss();
            }
            Log.d("map", "cancel retrieve location");
            finish();
          }
        });

    progressDialog.show();

    mLocClient = new LocationClient(this);
    mLocClient.registerLocationListener(myListener);

    LocationClientOption option = new LocationClientOption();
    option.setOpenGps(true); // 打开gps
    // option.setCoorType("bd09ll"); //设置坐标类型
    // Johnson change to use gcj02 coordination. chinese national standard
    // so need to conver to bd09 everytime when draw on baidu map
    option.setCoorType("gcj02");
    option.setScanSpan(30000);
    option.setAddrType("all");
    mLocClient.setLocOption(option);
  }
 /** 把user移入到黑名单 */
 private void moveToBlacklist(final String username) {
   final ProgressDialog pd = new ProgressDialog(getActivity());
   pd.setMessage("正在移入黑名单...");
   pd.setCanceledOnTouchOutside(false);
   pd.show();
   new Thread(
           new Runnable() {
             public void run() {
               try {
                 // 加入到黑名单
                 EMContactManager.getInstance().addUserToBlackList(username, false);
                 getActivity()
                     .runOnUiThread(
                         new Runnable() {
                           public void run() {
                             pd.dismiss();
                             Toast.makeText(getActivity(), "移入黑名单成功", 0).show();
                             refresh();
                           }
                         });
               } catch (EaseMobException e) {
                 e.printStackTrace();
                 getActivity()
                     .runOnUiThread(
                         new Runnable() {
                           public void run() {
                             pd.dismiss();
                             Toast.makeText(getActivity(), "移入黑名单失败", 0).show();
                           }
                         });
               }
             }
           })
       .start();
 }
 @Override
 protected void onPreExecute() {
   dialog = new ProgressDialog(act);
   dialog.setMessage("Loading...");
   dialog.setCanceledOnTouchOutside(false);
   dialog.show();
 }
 @Override
 protected void onPreExecute() {
   progressDialog = new ProgressDialog(this.context);
   progressDialog.setMessage("正在上传照片,请稍候...");
   progressDialog.setIndeterminate(false);
   progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
   progressDialog.setCanceledOnTouchOutside(false);
   progressDialog.setCancelable(true);
   progressDialog.setOnCancelListener(
       new DialogInterface.OnCancelListener() {
         @Override
         public void onCancel(DialogInterface dialogInterface) {
           alertUser();
         }
       });
   progressDialog.setButton(
       DialogInterface.BUTTON_POSITIVE,
       "取消",
       new DialogInterface.OnClickListener() {
         @Override
         public void onClick(DialogInterface dialogInterface, int i) {
           alertUser();
         }
       });
   progressDialog.setMax(total);
   progressDialog.show();
 }
Esempio n. 5
0
  private boolean displayDiscussionInfo() {

    final AlertDialog.Builder builder = new AlertDialog.Builder(DiscussionActivity.this);
    LayoutInflater inflater = DiscussionActivity.this.getLayoutInflater();
    final View v = inflater.inflate(R.layout.about_discussion, null);

    final ProgressDialog dia =
        ProgressDialog.show(DiscussionActivity.this, null, getString(R.string.alert_loading));
    dia.setCanceledOnTouchOutside(false);
    ParseQuery<Discussion> discussionQuery = Discussion.getDiscussionQuery();
    discussionQuery.getInBackground(
        discussionTableName,
        new GetCallback<Discussion>() {
          public void done(Discussion currentDiscussion, ParseException e) {
            if ((e == null) && (currentDiscussion != null)) {
              fetchDiscussionInformation(v, currentDiscussion);
            }

            dia.dismiss();
          }
        });

    builder
        .setView(v)
        .setTitle(discussionTopic + " (" + messagesList.size() + " messages)")
        .setPositiveButton(R.string.ok, null)
        .create()
        .show();

    return true;
  }
Esempio n. 6
0
 private void submit() {
   if (email.getText().toString().equals("")) {
     Toast.makeText(
             LoginActivity.this.getApplicationContext(),
             "Please fill Right email Id",
             Toast.LENGTH_SHORT)
         .show();
     return;
   }
   if (password.getText().toString().equals("")) {
     Toast.makeText(
             LoginActivity.this.getApplicationContext(),
             "Please fill password",
             Toast.LENGTH_SHORT)
         .show();
     return;
   } else {
     ProgressDialog progressDialog = new ProgressDialog(LoginActivity.this);
     progressDialog.setMessage("Loading...");
     progressDialog.setCanceledOnTouchOutside(false);
     if (id1 == 1 || id1 == 0) {
       new LoginAsynTask(LoginActivity.this, url, progressDialog, prepareHasMap()).execute("");
     } else {
       new PateintAsynTask(LoginActivity.this, url1, progressDialog, prepareHasMap()).execute("");
     }
   }
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.listview);
    cityListView = (ListView) findViewById(R.id.city_list);

    setTitle("选择城市");

    String webSite = "https://api.douban.com/v2/loc/list";

    if (progressDialog == null) {

      progressDialog = new ProgressDialog(this);
      progressDialog.setMessage("加载中");
      progressDialog.setCanceledOnTouchOutside(false);
      progressDialog.show();
    }

    HttpUtil.sendHttpRequest(
        webSite,
        new HttpCallbackListener() {
          @Override
          public void onFinish(String response) {
            progressDialog.dismiss();
            parseJSONWithJSONObjects(response);
          }

          @Override
          public void onError(Exception e) {}
        });
  }
 @Override
 protected void onPreExecute() {
   mProgressDialog.setMessage(getString(R.string.progress_dialog_aguarde));
   mProgressDialog.setCanceledOnTouchOutside(false);
   mProgressDialog.show();
   super.onPreExecute();
 }
Esempio n. 9
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    currentUser = ParseUser.getCurrentUser();
    CommonMethod.getInstance().loadListFriend(currentUser, this);
    registerBroastCastMain();
    final ProgressDialog progressDialog = new ProgressDialog(this);
    progressDialog.setMessage("Loading...");
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.show();
    new Handler()
        .postDelayed(
            new Runnable() {
              @Override
              public void run() {
                progressDialog.dismiss();
              }
            },
            3000);

    this.setContentView(R.layout.activity_main);
    this.initializeToolbar();
    this.initializeComponent();
    this.initializeProfileInformation();
    this.startService();
    callLogsDBManager = new CallLogsDBManager(this);
  }
    @NonNull
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
      btDevice = getArguments().getParcelable(KEY_BLUETOOTH_DEVICE);
      getActivity()
          .getApplicationContext()
          .bindService(new Intent(getActivity(), MetaWearBleService.class), this, BIND_AUTO_CREATE);

      reconnectDialog = new ProgressDialog(getActivity());
      reconnectDialog.setTitle(getString(R.string.title_reconnect_attempt));
      reconnectDialog.setMessage(getString(R.string.message_wait));
      reconnectDialog.setCancelable(false);
      reconnectDialog.setCanceledOnTouchOutside(false);
      reconnectDialog.setIndeterminate(true);
      reconnectDialog.setButton(
          DialogInterface.BUTTON_NEGATIVE,
          getString(R.string.label_cancel),
          new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
              currentMwBoard.disconnect();
              getActivity().finish();
            }
          });

      return reconnectDialog;
    }
Esempio n. 11
0
 // menu item save claim
 public void saveClaim(MenuItem menu) {
   progress = new ProgressDialog(this);
   progress.setTitle("Connecting");
   progress.setCanceledOnTouchOutside(false);
   progress.setMessage("Wait while the server connects and saves your information");
   new LoadingOnlineRecordTask().execute();
 }
Esempio n. 12
0
 protected void onPreExecute() {
   // create dialog here
   dialog = new ProgressDialog(MainActivity.this);
   dialog.setMessage("Fetching");
   dialog.setCanceledOnTouchOutside(false);
   dialog.show();
 }
 private void startProgress(CharSequence message) {
   if (mProgress == null) {
     mProgress = new NonSearchableProgressDialog(this);
     mProgress.setIndeterminate(true);
     mProgress.setCanceledOnTouchOutside(false);
     setProgressMessage(message != null ? message : getText(R.string.msg_validating_phone));
     mProgress.setOnCancelListener(
         new OnCancelListener() {
           @Override
           public void onCancel(DialogInterface dialog) {
             keepScreenOn(false);
             Toast.makeText(
                     NumberValidation.this, R.string.msg_validation_canceled, Toast.LENGTH_LONG)
                 .show();
             abort();
           }
         });
     mProgress.setOnDismissListener(
         new OnDismissListener() {
           public void onDismiss(DialogInterface dialog) {
             // remove sync starter
             if (mSyncStart != null) {
               mHandler.removeCallbacks(mSyncStart);
               mSyncStart = null;
             }
           }
         });
   }
   mProgress.show();
 }
Esempio n. 14
0
  /** 初始化视图 */
  private void initView() {
    mProgressDialog = new ProgressDialog(this);
    mProgressDialog.setMessage("正在加载中....");
    mProgressDialog.setCanceledOnTouchOutside(false);
    mProgressDialog.show();

    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);
    widthPixels = metrics.widthPixels;

    mAdapter = new OnWayAdapter(this, mList, widthPixels);
    mLvOnway.setAdapter(mAdapter);

    mLvOnway.setMode(PullToRefreshBase.Mode.BOTH);
    mLvOnway.setOnRefreshListener(
        new PullToRefreshBase.OnRefreshListener2<ListView>() {
          @Override
          public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
            mList.clear();
            mAdapter.notifyDataSetChanged();
            current_onway_id = "";
            loadData();
          }

          @Override
          public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
            current_onway_id = "OI000000000000000" + index;
            loadData();
            index = index - 10;
          }
        });
  }
Esempio n. 15
0
 private void showPdialog() {
   pDialog = new ProgressDialog(this);
   pDialog.setMessage(PROGRESSDIALOGMESSAGE1);
   pDialog.setCancelable(false);
   pDialog.setCanceledOnTouchOutside(false);
   pDialog.show();
 }
Esempio n. 16
0
 @Override
 protected void onPreExecute() {
   d = new ProgressDialog(ctx);
   d.setCancelable(false);
   d.setCanceledOnTouchOutside(false);
   d.setMessage("Descargando nueva versión...");
   d.show();
 }
Esempio n. 17
0
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   TAG = this.getClass().getSimpleName();
   mApp = GlobalApplication.getInstance();
   mLoadingDialog = new ProgressDialog(activity);
   mLoadingDialog.setCanceledOnTouchOutside(false);
   mLoadingDialog.setMessage("数据加载中...");
 }
 private void showProgressDialog() {
   if (mProgress == null) {
     mProgress = new ProgressDialog(this);
     mProgress.setMessage("is loading ......");
     mProgress.setCanceledOnTouchOutside(false);
   }
   mProgress.show();
 }
Esempio n. 19
0
 @Override
 protected void onPreExecute() {
   d = new ProgressDialog(context);
   d.setCancelable(false);
   d.setCanceledOnTouchOutside(false);
   d.setMessage("Cargando configuración...");
   d.show();
 }
Esempio n. 20
0
 @Override
 protected void onPreExecute() {
   dialog = new ProgressDialog(aContext);
   dialog.setMessage("Buscando Actividades...");
   dialog.setCancelable(false);
   dialog.setCanceledOnTouchOutside(false);
   dialog.show();
 }
Esempio n. 21
0
 public static void showProgressDialog(Context context, String string) {
   if (progressDialog == null) {
     progressDialog = new ProgressDialog(context);
     progressDialog.setMessage(string + "...");
     progressDialog.setCanceledOnTouchOutside(false);
   }
   progressDialog.show();
 }
Esempio n. 22
0
 @Override
 protected void onPreExecute() {
   d = new ProgressDialog(context);
   d.setCancelable(false);
   d.setCanceledOnTouchOutside(false);
   d.setMessage("Enviando CheckList...");
   d.show();
 }
  public void onPreExecute() {

    progresso = new ProgressDialog(vrActivity);
    progresso.setCancelable(false);
    progresso.setCanceledOnTouchOutside(false);
    progresso.setMessage("Buscando Dados...");
    progresso.show();
  }
 private void showProgressDialog() {
   if (progressDialog == null) {
     progressDialog = new ProgressDialog(this);
     progressDialog.setMessage("正在加载...");
     progressDialog.setCanceledOnTouchOutside(false);
   }
   progressDialog.show();
 }
Esempio n. 25
0
 private void showProgressDialog() {
   if (mProgressDialog == null) {
     mProgressDialog = new ProgressDialog(this);
     mProgressDialog.setMessage("正在加载。。。");
     mProgressDialog.setCanceledOnTouchOutside(false);
   }
   mProgressDialog.show();
 }
  @Override
  public Dialog onCreateDialog(Bundle savedInstanceState) {

    ProgressDialog pd = new ProgressDialog(getActivity());
    pd.setMessage(getString(R.string.please_wait));
    pd.setCanceledOnTouchOutside(false);
    return pd;
  }
Esempio n. 27
0
 @Override
 protected void onPreExecute() {
   super.onPreExecute();
   progressDialog = new ProgressDialog(getActivity());
   progressDialog.setMessage("fetching profile data..");
   //            progressDialog.setCancelable(false);
   progressDialog.setCanceledOnTouchOutside(false);
   progressDialog.show();
 }
Esempio n. 28
0
 @Override
 protected void onResume() {
   super.onResume();
   if (task != null && dialog == null) {
     dialog = ProgressDialog.show(this, null, getResources().getString(R.string.loading_message));
     CategoriesActivity.dialog.setCancelable(true);
     dialog.setCanceledOnTouchOutside(false);
   }
 }
Esempio n. 29
0
 @Override
 protected void onPreExecute() {
   super.onPreExecute();
   dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
   dialog.setMessage(getResources().getString(R.string.wait));
   dialog.setIndeterminate(true);
   dialog.setCanceledOnTouchOutside(false);
   dialog.show();
 }
Esempio n. 30
0
 private void showProgressDialog() {
   // TODO Auto-generated method stub
   if (progressDialog == null) {
     progressDialog = new ProgressDialog(this);
     progressDialog.setMessage("正在加载");
     progressDialog.setCanceledOnTouchOutside(false);
   }
   progressDialog.show();
 }