Exercise: Collect words and showing them in another Activity using Intent
with data passing
This is a continuation of the exercise Simple Activity to
collect words
When the user hits the "Show" button in the main Activity from the previous
exercise, the result must be shown in another Activity (not in a
Toast.makeText(...)).
- To do this you must first make another Activity class called
ShowActivity.java
- In the main Activity you must put the collected words into the Intent
object before calling startActivity(...) .
If you change the type of words from List<String> to
ArrayList<CharSequence>, you can use Intent.putExtra(someKey, words)
- In ShowActivity you must read the collected words , and
show it in the TextView.