【发布时间】:2019-06-13 22:43:47
【问题描述】:
在这里,我在 recyclerview 中设置了 firebase 适配器。 我在其中使用了这样的查询。
Query sortPost=PostRef.orderByChild("count").limitToFirst(firstTenPost);
在 tihs firstTenPost 中是 int 变量。现在我想通过一些检测来动态改变它的值。
举个例子, 假设我在 recyclerview 之外有按钮,如果我在按钮上设置了 onClickListner,那么它应该是这样的,
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{
//here, can i change the value of firstTenPost variable//
firstTenPost=firstTenPost+10;
}
});
所以有没有可能?如果是,请解释一下
【问题讨论】:
-
你想要实现什么,一个分页系统?
-
是的,@AlexMamo 你是对的
-
这是一个很常见的话题。请参阅stackoverflow.com/search?q=firebase+pagination。
-
你说“分页系统”?它应该是这样的,但我不知道这个话题和逻辑
标签: java android firebase firebase-realtime-database