只有步数计数。在c.getInt(c.getColumnIndex(HealthConstants.StepCount.COUNT))行中;但是我想要特定日期的小时数据。
private final HealthResultHolder.ResultListener<ReadResult> mListener = new HealthResultHolder.ResultListener<ReadResult>() {
@Override
public void onResult(ReadResult result) {
int count = 0;
Cursor c = null;
try {
c = result.getResultCursor();
if (c != null) {
while (c.moveToNext()) {
count += c.getInt(c.getColumnIndex(HealthConstants.StepCount.COUNT));
}
}
} finally {
if (c != null) {
c.close();
}
}
MainActivity.getInstance().drawStepCount(String.valueOf(count));
}
};