我有一个结构如下的表:
public class GroupDailyDB extends RealmObject{
@PrimaryKey
private int groupId;
private String groupName;
private String groupDescription;
private int groupStatus;
private boolean hasImage;
private int sweatPoints;
private long steps;
private int rank;
private float percentile;
private int noOfUsers;
private boolean isCurrentUserPartOfGroup;
private boolean isCurrentUserOwner;
}
我的数据已成功保存 我的 json 刷新时未发送组 ID 3,我需要更改其状态。
检查代码如下:
for(int i = 0 ; i < groupModel.getData().size() ; i++){
GroupDailyDB groupDailyDB =
realm.where(GroupDailyDB.class)
.notEqualTo("groupId",groupModel.getData().get(i).getGroupId())
.findFirst();
Log.i(TAG,"Group id delete daily: "+groupDailyDB.getGroupId());
}
但是我的日志分别打印 id 4,5 它永远不会返回我 id 3