コード例 #1
0
  private void pullWetherFromNet(final String w) {
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(new Date());
    int xx = calendar.get(Calendar.HOUR_OF_DAY);
    int xx2 = calendar.get(Calendar.MINUTE) + xx * 60;

    if (xx2 > (6 * 60 + 56) && xx2 < (7 * 60 + 59)) {
      HttpRequestManager.getInstance(mContent.getApplicationContext())
          .request_whether(
              w,
              new Callback() {
                @Override
                public void onFailure(Request request, IOException e) {}

                @Override
                public void onResponse(Response response) throws IOException {
                  if (response != null && response.body() != null) {
                    final String res = new String(response.body().string());
                    if (mLL != null) {
                      mLL.onWhetherResult(res);
                    }
                  }
                }
              });
    }
  }
コード例 #2
0
  private void pullWetherFromNet(
      final String realCode, final float buyprice, final float low, final float high) {
    HttpRequestManager.getInstance(mContent.getApplicationContext())
        .request_stock(
            realCode,
            new Callback() {
              @Override
              public void onFailure(Request request, IOException e) {}

              @Override
              public void onResponse(Response response) throws IOException {
                if (response != null && response.body() != null) {
                  final String res = new String(response.body().string());
                  if (mLL != null) {
                    mLL.onStockResult(realCode, buyprice, low, high, res);
                  }
                }
              }
            });
  }