当前位置:网站首页>JSON data format usage
JSON data format usage
2022-07-27 16:42:00 【Young people in Baima town】
public SearchOrderBean typeBean;//SearchOrderBean Inside the entity class are the data types and parameters returned by the background typeBean Accessible elsewhere
public void serchOrder() {
ActivateDevice mo = ShareInfo.getObject(ActivateDevice.class);
// Parameters
Map<String, String> map = new HashMap<>();
map.put(Constans.MERCHANTID, mo.getMerchantId());
map.put(Constans.STOREID, mo.getStoreId());
map.put(Constans.DEVICEID, mo.getDeviceId());
map.put(Constans.PAGE, page + "")
// Access interface
SSClient.getInstance().doRequest01(BaseParams.getBaseAddressUrl02(PosInterface.PAY_ORDER_LIST), map, new SSLCallBack() {
@Override
public void onFailed(Call call, IOException e) {
// Failure
}
@Override
public void onReponse(Call call, String response) {
// Parsing data
JSONObject jsonObject = JSON.parseObject(response);
String proInfo = jsonObject.getString("data");//data Fields in data
String tips = jsonObject.getString("tips");//tips Fields in data
typeBean = JSON.parseObject(response, SearchOrderBean.class);
Request data loading in the sub thread
((Activity) binding.getRoot().getContext()).runOnUiThread(new Runnable()
{
@Override
public void run() {
binding.recyclerView.setAdapter(mAdapter = new OneAddpter(binding.getRoot().getContext(),listdat ));
binding.recyclerView.setLayoutManager(new StaggeredGridLayoutManager(1, StaggeredGridLayoutManager.VERTICAL));
mAdapter.notifyDataSetChanged();// Refresh changed data
// Set up item Click events for
mAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClickListener(View view, int position) {
Log.e("TAG", " You clicked item Click events for ");
Intent intent = new
Intent(binding.getRoot().getContext(),
OrderDetailActivity.class);
intent.putExtra("tradeNo",
typeBean.getData().getSmtransactionConditions().get(position).getTradeNo());
binding.getRoot().getContext().startActivity(intent);
}
});
}
});
}
});
}
边栏推荐
猜你喜欢

Reduce PDF document size (Reprint)

The difference and use between get request and post request

Matlab legend usage

201403-1

Implementation of ByteDance service grid based on Hertz framework

DRF learning notes (V): viewset

Leetcode234 question - simple method to judge palindrome linked list

Exe program encryption lock

solidwork装配体导入到Adams中出现多个Part重名和Part丢失的情况处理

CCF-201312-1
随机推荐
OpenCV(五)——运动目标识别
将IAR工程文件夹转移目录后无法进入函数定义解决
solidwork装配体导入到Adams中出现多个Part重名和Part丢失的情况处理
Exe program encryption lock
training on multiple GPUs pytorch
DRF learning notes (I): Data Serialization
Addition of large numbers
excel skill
Array analog linked list
The 31st --- the 52nd
CCF-201312-1
Duplicate numbers in array
Thesis reduction
OpenCV(三)——图像分割
Some queries of TP5
Gurobi——GRBEnv
COMS Technology
mvc和mvp和mvvm的区别
The difference and use between get request and post request
The difference between select/poll/epoll