// 接收 type = RequestType.REQUEST_1 或者type = RequestType.REQUEST_2 的响应时运行 @ReceiveType(type = {RequestType.REQUEST_1, RequestType.REQUEST_2}) void dowsd(FluxResponse response) { int sum = (int) response.getData("sum"); msg4 = "type = {RequestType.REQUEST_1, RequestType.REQUEST_2} => " + sum; saveStates(); tv4.setText(msg4); }
// 接收 type = "2" 的响应时运行 @ReceiveType(type = "2") void doCcf2(FluxResponse response) { int sum = (int) response.getData("sum"); msg2 = "type = \"2\" => " + sum; saveStates(); tv2.setText(msg2); }
// 接收 type = "2" 或者type = "2" 的响应时运行 @ReceiveType(type = {"1", "2"}) void dowsd2(FluxResponse response) { int sum = (int) response.getData("sum"); msg3 = "type = {\"1\", \"2\"} => " + sum; saveStates(); tv3.setText(msg3); }
// 接收 type = "1" 的响应时运行 @ReceiveType(type = {"1"}) void doCcf(FluxResponse response) { int sum = (int) response.getData("sum"); msg1 = "type = {\"1\"} => " + sum; saveStates(); tv1.setText(msg1); }