Esempio n. 1
0
 /**
  * 吐出一个显示时间较短的提示
  *
  * @param formatResId
  * @param args
  */
 public void toastS(final int formatResId, final Object... args) {
   handler.post(
       new Runnable() {
         @Override
         public void run() {
           ToastUtils.toastS(getBaseContext(), getString(formatResId, args));
         }
       });
 }
Esempio n. 2
0
 /**
  * 吐出一个显示时间较短的提示
  *
  * @param format
  * @param args
  */
 public void toastS(final String format, final Object... args) {
   handler.post(
       new Runnable() {
         @Override
         public void run() {
           ToastUtils.toastS(getBaseContext(), String.format(format, args));
         }
       });
 }
Esempio n. 3
0
 /**
  * 吐出一个显示时间较短的提示
  *
  * @param resId
  */
 public void toastS(final int resId) {
   handler.post(
       new Runnable() {
         @Override
         public void run() {
           ToastUtils.toastS(getBaseContext(), resId);
         }
       });
 }
Esempio n. 4
0
 /**
  * 吐出一个显示时间较短的提示
  *
  * @param content
  */
 public void toastS(final String content) {
   handler.post(
       new Runnable() {
         @Override
         public void run() {
           ToastUtils.toastS(getBaseContext(), content);
         }
       });
 }
Esempio n. 5
0
 /**
  * 吐出一个显示时间较短的提示
  *
  * @param view
  */
 public void toastS(final View view) {
   handler.post(
       new Runnable() {
         @Override
         public void run() {
           ToastUtils.toastS(getBaseContext(), view);
         }
       });
 }
Esempio n. 6
0
 /**
  * 弹出一个进度对话框
  *
  * @param message 消息
  */
 public void showProgressDialog(final String message) {
   if (!haveDestroy) {
     handler.post(
         new Runnable() {
           @SuppressWarnings("deprecation")
           @Override
           public void run() {
             Bundle bundle = new Bundle();
             bundle.putString(KEY_DIALOG_MESSAGE, message);
             showDialog(DIALOG_PROGRESS, bundle);
           }
         });
   }
 }
Esempio n. 7
0
 /**
  * 弹出一个消息对话框
  *
  * @param message 消息
  * @param confrimButtonName 确定按钮的名字
  */
 public void showMessageDialog(final String message, final String confrimButtonName) {
   if (!haveDestroy) {
     handler.post(
         new Runnable() {
           @SuppressWarnings("deprecation")
           @Override
           public void run() {
             Bundle bundle = new Bundle();
             bundle.putString(KEY_DIALOG_MESSAGE, message);
             bundle.putString(KEY_DIALOG_CONFRIM_BUTTON_NAME, confrimButtonName);
             showDialog(DIALOG_MESSAGE, bundle);
           }
         });
   }
 }
Esempio n. 8
0
 /** 关闭进度对话框 */
 public void closeProgressDialog() {
   if (!haveDestroy) {
     handler.post(
         new Runnable() {
           @SuppressWarnings("deprecation")
           @Override
           public void run() {
             try {
               dismissDialog(DIALOG_PROGRESS);
             } catch (Throwable throwable) {
               throwable.printStackTrace();
             }
           }
         });
   }
 }