The
ResultActivity
launches the
GetterActivity
and sends a prompt string to it.
The
GetterActivity
returns an integer value to the
ResultActivity
.
It also returns a result code,
hopefully
Activity.RESULT_OK
ResultActivity
.
Should we think of the
ResultActivity
as a client and the
GetterActivity
as a server?
The
ResultActivity
calls
startActivityForResult
(twice)
instead of the
startActivity
we saw
here.
The
GetterActivity
calls
setResult
.
A
SpannableString
is a string whose substrings can be decorated with
underlining,
strike-through,
foreground
color
etc.
ResultActivity.java
main.xml
:
monospace
typeface
to right-justify the numbers.
I hope we never see the “Did not receive” message.
GetterActivity.java
getter.xml
:
a
horizontal
LinearLayout
inside a
vertical
one.
Note the
EditText
’s
layout_width
and
layout_weight
.
AndroidManifest.xml
has a second
activity
element.