简体   繁体   English

我的代码中有错误,用于将 aduio url(从 Firebase 检索)从适配器类传递到片段

[英]I have error in my code, which is for passing aduio url (Retrieved from Firebase) from a adapter class to a fragment

在此处输入图片说明 Here is the code in which error exists...这是存在错误的代码...

What should I do?我应该怎么办?

You seem to be mixing method parameter concepts.您似乎在混合方法参数概念。 You don't need to declare a variable type when invoking a method ie: new string();调用方法时不需要声明变量类型,即: new string();

This is typically done for defining the function adapter MyAdaptor(string input){} Simply removing the type definition will change options from a parameter to a variable这通常用于定义函数adapter MyAdaptor(string input){}简单地删除类型定义会将options从参数更改为变量

 new recyclerViewAdapter(options);

Just ensure that your "options" are declared and defined before trying to use it.在尝试使用它之前,只需确保您的“选项”已声明定义

Definition定义

Creating a new FirebaseRecyclerOptions typically follows this structure创建新的 FirebaseRecyclerOptions 通常遵循此结构

 FirebaseRecyclerOptions<model> options =
                new FirebaseRecyclerOptions.Builder<model>()
                        .setQuery(query, model.class)
                        .build();

Source: https://github.com/firebase/FirebaseUI-Android/blob/master/database/README.md来源: https : //github.com/firebase/FirebaseUI-Android/blob/master/database/README.md

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何与我的适配器类中的片段进行通信 - How to communicate with fragment from my adapter class 即使我在我的适配器 class 中初始化它,我是否可以从不同的 Activity/Fragment 暂停/停止 ExoPlayer? - Can I pause / stop ExoPlayer from a different Activity / Fragment even though I initialize it in my Adapter class? 当从 HashMap 检索的类名(带包)通过 Class.forName() 时,为什么我无法获取该类? - Why I cannot get the class when the classname(with package) which is retrieved from a HashMap is passing through Class.forName()? 从适配器 class 中的 Firebase 中删除 - Delete from Firebase in an Adapter class 将数据从活动发送到对话框,其中自定义适配器和我的自定义适配器在片段中 - Send Data from Activity to Dialog which in Custom adapter and my custom adapter is in fragment 我在将数据从父活动传递到 BottomViewNavigation 上的子片段时遇到问题 - I have issues passing data from my parent activity to a child fragment on a BottomViewNavigation Android Firebase,在警报对话框中显示从Firebase检索的图像 - Android Firebase , show image which is retrieved from firebase in alert dialog 来自适配器的开放片段 model class - open fragment from adapter model class 从Android中的适配器访问Fragment内的类 - Accessing Class inside Fragment from Adapter in Android 如何将数据从 FireBase 检索到我的适配器而不是关键 - How can I retrieve data from FireBase to my adapter not the key
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM