Closed csaq7151 closed 6 years ago
Hi! Thanks for all the detail. Updating global primitive variables will not update the reference in the Material About List, therefore you need to store the ActionItem that you're putting in the list as a global variable and when you get the updated phone number from the database you need to reference the phoneActionItem
and call .setSubText(phone)
and .setOnClickAction(ConvenienceBuilder.createPhoneOnClickAction(getActivity(), phone)
and then refreshMaterialAboutList()
. This is a limitation of Java!
Solved it by passing the object from the activity to the fragment. In this case the builder can already use all of the loaded strings. So no need to refresh the List
There are two examples of how to update the items here: https://github.com/daniel-stoneuk/material-about-library/blob/master/app/src/main/java/com/danielstone/materialaboutlibrarydemo/ExampleMaterialAboutFragment.java.
Yeah, sorry I didn't see that message at first. Just wanted to clarify how to use dynamic items if you do need to in the future :)
Thanks for your help. Great library by the way. Exactly what I wanted and everything is working ;)
Hi,
I´m trying to display dynamic content loaded from a firebase database into one of the cards. However the are showing empty strings where the content of the database should appear.
global variable
String phone = "";
then one of my infoCards
My onCreate
and the methode readUserStuff
So the output of the LOGs is as follows.
First the Log with in the getMaterialAboutList:
= therefore the cards are empty (expected behaviour)
then the methode readUserStuff() has the Log output
then refreshMaterialAboutList() is called and the Log in the getMaterialAboutList says:
BUT the cards remain empty no matter how often I call refresh. Also recreating the activity has the same result.
Any Idea?