示例#1
0
 @Override
 public void handleMessage(Message msg) {
   if (msg.what == 1) {
     CustomToast.showCustomToast(
         getApplicationContext(),
         Constants.SERVER_DOWN_ERROR,
         Constants.TOAST_VISIBLE_LONG,
         layoutInflater);
   } else if (msg.what == 2) {
   } else if (msg.what == 3) {
     CustomToast.showCustomToast(
         getApplicationContext(),
         msg.getData().getString("message"),
         Constants.TOAST_VISIBLE_LONG,
         layoutInflater);
   } else if (msg.what == 4) {
     CustomToast.showCustomToast(
         getApplicationContext(),
         Constants.DATABASE_ERROR,
         Constants.TOAST_VISIBLE_LONG,
         layoutInflater);
   } else if (msg.what == 11) {
     CustomToast.showCustomToast(
         getApplicationContext(),
         Constants.JSON_EXCEPTION_ERROR,
         Constants.TOAST_VISIBLE_LONG,
         layoutInflater);
   } else if (msg.what == 12) {
     // CustomToast.showCustomToast(getApplicationContext(),
     // Constants.NO_CONNECTION_ERROR, Constants.TOAST_VISIBLE_LONG,
     // layoutInflater);
   }
 }
示例#2
0
 @Override
 protected void onResume() {
   super.onResume();
   String errorMsg = getIntent().getStringExtra("errorToast");
   if (errorMsg != null && !"".equals(errorMsg.trim())) {
     CustomToast.showCustomToast(
         getApplicationContext(), errorMsg, Constants.TOAST_VISIBLE_LONG, layoutInflater);
   }
 }