Phew, now we've downloaded
the container, we can go ahead and
actually do something in
our app that uses it.
We can get things out and
use them where we want.
It's a simple matter of knowing
the key and retrieving the value.
First Get the ContainerHolder.
Then retrieve the value by key.
Obviously, you have to
know the exact key.
Here's how we get the daily
special: we just call getString and
pass the key daily-special.
And that's all there is too it.
Whenever the daily special updates, your
app will automatically get the latest
value without you having to
make any changes to the code.
Note, though, that the update only
takes effect when the app is restarted,
because the code to get the container
is in the onCreate method.
To try it out, update your app to
show the latest daily special.
In the ShowDailySpecial activity,
define the method Update daily special
that get's the daily special
out of the container and
updates the relevant text view so
that your users can actually see it.
And make sure that you actually
call update daily special
in the on create method.
Run the app and show the daily special.
And then In the Tag Manager dashboard,
go ahead and change the daily special.
Don't forget to publish your changes,
and
then restart your app and
see if you get the new value.
And hopefully the daily
special will have changed.
And go ahead and
check all the boxes when you're done.