这是我的Java代码:
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_tools, container, false);
recycler_view = root.findViewById(R.id.recycler_view);
recycler_view.setHasFixedSize(true);
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageReference = storage.getReference("Quotes");
Log.e("STORAGE REF : " , String.valueOf(storageReference));
String arr[] = new String[]{};
for (int i =0;i<= Integer.parseInt(storageReference.getPath());i++){
}
((MainActivity) getActivity()).getSupportActionBar().setTitle("Quran Quotes");
final ProgressDialog pd = new ProgressDialog(getActivity());
pd.setMessage("Loading");
pd.show();
final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
recycler_view.setLayoutManager(linearLayoutManager); // set LayoutManager to RecyclerView
quotesModelList = new ArrayList<>();
我在Logcat中有存储参考:
E/STORAGE REF :: gs://mosque-614df.appspot.com/Quotes
答案 0 :(得分:0)
首先将任何图像上传到Firebase存储时,您必须将图像下载URL存储到Firebase数据库中。(将任何图像上传到Firebase存储时,您将在图片上传成功。)
因此要在recyclerView中显示图像列表,只需调用 firebase-database参考,您将立即获得所有图像。