ArrayList<SmsBean> smsList = new ArrayList<>();
SmsBean smsBean = new SmsBean();
smsBean.setSender("***********");
smsBean.setTitle("test title");
smsList.add(smsBean);
SmsBean smsBean2 = new SmsBean();
smsBean2.setSender("******");
smsBean2.setTitle("test title2");
smsList.add(smsBean2);
Log.d(TAG,"smsList:"+ JSON.toJSONString(smsList));
Log.d(TAG,"smsBean:"+ JSON.toJSONString(smsBean));
smsList:[{},{}]
smsBean:{}
![]() |
1
AoEiuV020CN 142 天前
看不出毛病,可以的话搞个问题 demo 项目到 github 发出来,
或者先贴一下 SmsBean 的代码, |
![]() |
2
hello2090 142 天前 via iPhone
不懂 android 但你可以 debug 吗?放个断点到 smallish.add 看看呢
|
![]() |
3
hello2090 142 天前 via iPhone
或者 tojsonstring() 要求实现的函数 smsbean 实现了吗
|
![]() |
4
whyrookie 142 天前
可以进到 JSON.toJSONString 函数里面看看
|
5
NexTooo 142 天前
看上去没问题,你看下最后的 Json.toJSONString 方法实现?
可能区别在这儿 |
![]() |
6
Features OP |
![]() |
7
ykrank 142 天前
不要用 fastjson
|
![]() |
8
hongch 142 天前
7L 正解
|
![]() |
9
AoEiuV020CN 142 天前
@Features #6 有没有混淆,混淆导致 field 和 getter/setter 名字对不上也会出这种问题,
|
![]() |
10
Features OP @AoEiuV020CN 刚刚学习开发 uniapp 的插件,还不太了解原因
|