我将产品列表添加到Azure Table Storage
,并将产品列表存储在ArrayList
中并显示在Tablelayout
中..我的问题ArrayList
只获得50个值..如何解决这个问题。请帮帮我。
MobileServiceTable<ProductList> ProductBrand = mClient.getTable("ProductList", ProductList.class);
ProductBrand.where().field("enable").eq(val(true)).execute(new TableQueryCallback<ProductList>() {
public void onCompleted(List<ProductList> results, int count, Exception error, ServiceFilterResponse response) {
final ArrayList<ProductList> list3 = new ArrayList<ProductList>();
for (ProductList item : results) {
list3.add(item);
}
for(int c=0;c<list3.size();c++)
Toast.makeText(getBaseContext(),"Size:"+list3.size()+"Product "+list3.get(c).toString(), Toast.LENGTH_SHORT).show(); }
});
答案 0 :(得分:2)
Azure Mobile Services
默认返回50条记录,您可以通过首先将EnableQueryAttribute添加到您的公众&#39; GET&#39;来解决此问题。方法,例如
[EnableQuery(MaxTop(1000)]
public IEnumerable<Product> Get()
{
...
}
现在,您可以使用Take
方法申请一定数量的产品
MobileServiceTable<ProductList> ProductBrand =
mClient.getTable("ProductList", ProductList.class).Take(1000);
要避免在服务器上进行任何分页,请使用IncludeTotalCount
方法