Пример #1
0
 @Override
 protected void onReceiveResult(int resultCode, Bundle resultData) {
   super.onReceiveResult(resultCode, resultData);
   String helloText = (String) resultData.get("Hello");
   int newTweetCount = resultData.getInt("count");
   Toast.makeText(TimelineActivity.this, "count : " + newTweetCount, Toast.LENGTH_LONG).show();
   mStatusList.add(newTweetCount, null);
   mStatusAdapter.notifyItemInserted(newTweetCount);
   mSwipeRefreshLayout.setRefreshing(false);
 }
Пример #2
0
 @Override
 protected void onReceiveResult(int resultCode, Bundle resultData) {
   super.onReceiveResult(resultCode, resultData);
   switch (resultCode) {
     case Status.STARTED:
       {
         onStarted();
         break;
       }
     case Status.OK:
       {
         onSuccess(resultData);
         break;
       }
     case Status.ERROR:
       {
         int errorCode = resultData.getInt(RestUtils.ERROR_CODE);
         String errorMessage = resultData.getString(RestUtils.ERROR_MESSAGE);
         onError(errorCode, errorMessage);
         break;
       }
     case Status.EXCEPTION:
       {
         onException();
         break;
       }
     case Status.PROGRESS:
       {
         int progress = resultData.getInt(RestUtils.RESULT_PROGRESS);
         int total = resultData.getInt(RestUtils.RESULT_TOTAL);
         onProgress(progress, total);
         break;
       }
     case Status.CANCELED:
       {
         onCanceled();
         break;
       }
   }
 }