예제 #1
0
 private void addfavorite() {
   PopupText pt = Resource.buildPopupText();
   try {
     ServiceWrapper sw = engine.getServiceWrapper();
     sw.addFavoritegd();
     if (sw.isServiceSuccessful()) {
       pt.setText("添加收藏夹成功");
     } else {
       pt.setText("添加收藏夹失败, 原因: " + sw.getServiceMessage());
     }
   } catch (Exception e) {
     e.printStackTrace();
     pt.setText("添加收藏夹失败,请稍后重试");
   }
   pt.popup();
 }
예제 #2
0
 private boolean fetchRank() {
   PopupText pt = Resource.buildPopupText();
   try {
     java.util.Date loginTime = engine.getEngineService().getLoginTime();
     java.util.Date start = DateUtil.getMonthStartTime(loginTime);
     java.util.Date end = DateUtil.getNextMonthStartTime(loginTime);
     ServiceWrapper sw = engine.getServiceWrapper();
     rankingList = sw.queryRankingList(start, end, 0, 10);
     if (!sw.isServiceSuccessful()) {
       pt.setText("读取排行榜失败,原因:" + sw.getServiceMessage());
       pt.popup();
       return false;
     }
     int attainmentId = engine.calcAttainmentId(loginTime);
     attainment = sw.readAttainment(attainmentId, start, end);
     return true;
   } catch (Exception e) {
     e.printStackTrace();
     pt.setText("读取排行榜失败,原因:" + e.getMessage());
     pt.popup();
     return false;
   }
 }