Пример #1
0
 @Override
 protected void onDestroy() {
   haveDestroy = true;
   handler.destroy();
   activityPool.removeSelf();
   super.onDestroy();
 }
Пример #2
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));
         }
       });
 }
Пример #3
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));
         }
       });
 }
Пример #4
0
 /**
  * 吐出一个显示时间较短的提示
  *
  * @param resId
  */
 public void toastS(final int resId) {
   handler.post(
       new Runnable() {
         @Override
         public void run() {
           ToastUtils.toastS(getBaseContext(), resId);
         }
       });
 }
Пример #5
0
 /**
  * 吐出一个显示时间较短的提示
  *
  * @param content
  */
 public void toastS(final String content) {
   handler.post(
       new Runnable() {
         @Override
         public void run() {
           ToastUtils.toastS(getBaseContext(), content);
         }
       });
 }
Пример #6
0
 /**
  * 吐出一个显示时间较短的提示
  *
  * @param view
  */
 public void toastS(final View view) {
   handler.post(
       new Runnable() {
         @Override
         public void run() {
           ToastUtils.toastS(getBaseContext(), view);
         }
       });
 }
Пример #7
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);
           }
         });
   }
 }
Пример #8
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);
           }
         });
   }
 }
Пример #9
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();
             }
           }
         });
   }
 }