Я пытаюсь получить name и list_image из дочернего элемента List основного дочернего элемента.
Здесь я беру идентификатор с предыдущей карты для извлечения внутренней информации, но я не могу получить данные, не могу найти реальную проблему.
![enter image description here](https://i.stack.imgur.com/MKxYj.png)
public class fund_list extends AppCompatActivity {
private DatabaseReference listref_basic, listref_advanced;
String FundId = "";
private static final String TAG = "MyActivity";
RecyclerView list_recyclerview;
RecyclerView.LayoutManager layoutManager;
FirebaseRecyclerAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fund_list);
listref_basic = FirebaseDatabase.getInstance().getReference().child("Basic");
//listref_advanced = FirebaseDatabase.getInstance().getReference().child("Advanced");
list_recyclerview = (RecyclerView) findViewById(R.id.list_RecyclerView);
list_recyclerview.setHasFixedSize(true);
layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
list_recyclerview.setLayoutManager(layoutManager);
if (getIntent() != null) {
Log.i(TAG, "inside 1st if statement ");
FundId = getIntent().getStringExtra("FundId");
}
if (!FundId.isEmpty()) {
Log.i(TAG, "inside 2nd if statement ");
getList(FundId, listref_basic);
}
}
private void getList(String fundId, DatabaseReference DR) {
DR.child(fundId).child("List");
Log.i(TAG, "inside getlist method ");
FirebaseRecyclerOptions<List> options =
new FirebaseRecyclerOptions.Builder<List>()
.setQuery(DR, List.class)
.build();
Log.i(TAG, "after options ");
adapter = new FirebaseRecyclerAdapter<List, List_holder>(options) {
@Override
protected void onBindViewHolder(@NonNull List_holder holder, int position, @NonNull List model) {
holder.setName(model.getName());
holder.setList_image(getApplicationContext(), model.getList_image());
Log.i(TAG, "inside onbind");
}
@NonNull
@Override
public List_holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.list_card, parent, false);
return new List_holder(view);
}
};
list_recyclerview.setAdapter(adapter);
adapter.startListening();
adapter.notifyDataSetChanged();
Log.i(TAG, "after set adapter ");
}
Вот изображение Firebase, которое я пытался получить.