我想从firebase中获取2个对象,并想使用viewmodel在Recyclerview上显示合并结果。我创建了一个视图模型,该模型从firebase获取一个对象,并且基于该对象的id,我想获取另一个对象并更新ui。 一些视图模型类的代码
figure
imagesc(transpose(all_area_for_visual));
colormap("jet")
colorbar('Ticks',0:3,'TickLabels',{'Home ','Field','Bad house','Good house'})
xlabel('Time (min)')
tickLocs = round(linspace(1,length(final_plot_mat_missing_part(2:end,1)),8));
timeVector = final_plot_mat_missing_part(2:end,1);
timeForTicks = (timeVector(tickLocs))./60;
xticks(tickLocs);
xticklabels(timeForTicks);
%xlim([0 325]);
ylabel('Car identity')
yticks(1:length(Ucolumnnames_fpm))
yticklabels([Ucolumnnames_fpm(1,:)])
FirebaseQueryLiveData类
public static void main(String[] args)
{
firstThreeDigits() ;
}
public static void firstThreeDigits()
{
Random randomNumber= new Random();
int[] firstArray= new int[3];
for (int i = 0,j=0; ;j++) //i for array index and j for running loop until we get 3 numbers which are not 4 or 6
{
int number=randomNumber.nextInt(10);
if(!(number==4||number==6)) //if random number is NOT 4 or 6
{
firstArray[i]=number; // add to array
i++;
if(i==3) // print three number from array and break the loop
{
for(int num:firstArray)
{
System.out.println(num);
}
break;
}
}
}
}
如何使用first的结果从firebase中获取第二个对象并将其通知实时数据
第一个对象是用户的帖子,第二个对象是userinfo。我想在Ui上显示合并结果。