private void getSensorZValue(Sensor sensor) { if (isCurrentLotActivited) { AppContext.getInstance().getVolleyTools().fetchNodeHeartBeat(handler, sensor); Toast.makeText( getActivity(), "正在获取" + currentSensor.getNfcCode() + "节点的地磁值", Toast.LENGTH_SHORT) .show(); } else { AppContext.getInstance().getVolleyTools().fetchSensorSetRequest(handler, sensor); Toast.makeText( getActivity(), "正在获取" + currentSensor.getNfcCode() + "节点的配置请求信息", Toast.LENGTH_SHORT) .show(); } }
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (getArguments().getString("sensorCode") == null) { return; } isCurrentLotActivited = getArguments().getBoolean("isCurrentLotActivited"); sensorCode = getArguments().getString("sensorCode"); currentSensor = new Sensor(); currentSensor.setCode(sensorCode); // currentSensor = (Sensor) getArguments().getSerializable("sensor"); viewEvent(); }