Android Firebase database: how to retrieve multiple rows? -
this database structure:
what trying do, fill listview elements in database, in custom layout 3 textview each line:
title
date
text
title
date
text
title
date
text
i tried custom adapter, extending firebaselistadapter<>,with class store data, can't solve problem.
can me, please?
firebasedatabase database = firebasedatabase.getinstance(); databasereference myref = database.getreference(); myref.addlistenerforsinglevalueevent(new valueeventlistener() { @override public void ondatachange(datasnapshot datasnapshot) { if (datasnapshot.haschildren()) { (datasnapshot datasnapshot1 : datasnapshot.getchildren()) { your_module_obj= datasnapshot1.getvalue(your_module_class_name.class); } } } @override public void oncancelled(databaseerror error) { log.w("dd", "failed read value.", error.toexception()); } });
Comments
Post a Comment