SetText new Date toString
The first difference is that rather than setting the content view to be a view we created in Java code, we set it to reference the XML layout (). The source file will be updated when we rebuild this project to include a reference to our layout file (stored as in our project’s directory).
The other difference is that we need to get our hands on our instance, for which we use the call. Since we identified our button as , we can reference the button’s identifier as . Now, with the instance in hand, we can set the callback and set the label as needed.
As you can see in Figure 5‑1, the results look the same as with the original demo.
Figure 5‑1. The NowRedux sample activity
Дата добавления: 2015-05-16; просмотров: 929;