コード例 #1
0
 @Override
 public void run() {
   if (type.equals("single")) {
     new MiServerAPI(SnsAPI.get_allSns().get("mango").getSid())
         .getSingerVotes(
             MangerDate.programBean.getId_item(),
             singerVotesServiceRequestListener,
             ACTION.GETSINGERVOTES);
   } else if (type.equals("all")) {
     new MiServerAPI(SnsAPI.get_allSns().get("mango").getSid())
         .getSingerVotes("all", singerVotesServiceRequestListener, ACTION.GETSINGERVOTES);
   }
 }
コード例 #2
0
 @Override
 public void onComplete(String response, ACTION action) {
   Log.d(LOG_TAG, response);
   Message message = Message.obtain();
   try {
     message.arg1 = action.ordinal();
     if (action.equals(ACTION.GETSINGERVOTES)) {
       if (SnsAPI.get_allSns().get("mango").getSid() != null
           && !SnsAPI.get_allSns().get("mango").getSid().equals("null")) {
         JsonForDate.voteSinger(response, ShowSingerActivity.getInstance().getSingerBeans());
       } else {
         JsonForDate.getSingerVotes(
             response, ShowSingerActivity.getInstance().getSingerBeans());
       }
       message.what = 1;
       message.obj = ShowSingerActivity.getInstance().getSingerBeans();
     }
   } catch (JSONException e) {
     e.printStackTrace();
     message.what = 0;
     message.obj = e;
   }
   singerVotesServiceHandler.sendMessage(message);
 }