我正在尝试计算我的 android java 代码中的 azure 数据库表的行数。不幸的是,azure 库中没有内置 count() 方法。最接近它的是 includeInlineCount() 方法。我使用了以下代码行:
final MobileServiceList<Crime> result = mToDoTable.includeInlineCount().execute().get();
返回每行第一列的值。 result
的值如下所示:
[column1_row1_String, column1_row2_String, column1_row3_String]
如何从值结果中提取字符串数量?
最佳答案
根据MobileServiceList
类的源代码,您可以使用 method getTotalCount()
尝试下面的代码.
final MobileServiceList<Crime> result = mToDoTable.includeInlineCount().execute().get();
int count = result.getTotalCount();
关于java - 计算从 Azure 查询返回的字符串数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35872031/