赞
踩
Person person = new Person();
double amount = 0;
if (cursor != null && cursor.moveToFirst()) {
int indexOfPerson = cursor.getColumnIndex(Calculate.COLUMN_PERSON);
int indexOfAmount = cursor.getColumnIndex(Calculate.COLUMN_AMOUNT);
String personStr = cursor.getString(indexOfPerson);
person = JSONObject.parseObject(personStr, Person.class);
amount = cursor.getDouble(indexOfAmount);
}
if (cursor != null && cursor.moveToFirst()) {
Role[] roles = new Role[cursor.getCount()];
int roleIndex = cursor.getColumnIndex(Role.COLUMN_ROLE);
while (cursor.moveToNext()) {
Role role = JSONObject.parseObject(cursor.getString(roleIndex), Role.class);
roles[cursor.getPosition()] = role;
}
return roles;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。