Lecture 4 - Calling Sub-Activities 2
Sending and Retrieving Data with Sub-activities
Download the above resource file.
Study how Toast widget works ('ShowToast' project).
Study how to read an image file in assets folder and show the image on ImageView widget ('ShowImage' project).
Copy the 'ShowImage' project as a new project.
Add an EditText widget.
When a user types 'apple' in the EditText widget and click the button, let the user move to the second activity to show an apple image.
If the data the user typed is not 'apple', show a Toast message that you can't show the image.
Use the same project (exercise 4.3).
Add the banana and coconut image to the second acitivity.
When a user types 'apple', 'banana' or 'coconut' in the EditText widget and click the button, let the user move to the second activity to show an appropriate image.
If the name of an image the user typed is not available, show a Toast message that you can't show the image.
Use the above project (exercise 4.4).
Add EditText and Button widets to the second acitivity.
When a user types a number and clicks the button in the second activity, go back to the first activity and show the number.
CheckBox and RadioButton
Study how to get a choice with CheckBox widget. ('CheckSimple' project).
Use the above project. Offer more options to users and display the result users have chosen.
Study how to get a choice from multiple options with RadioButton widget. ('RadioSimple' project).
Use the above project. Make another option group and show how to manage multiple radio button groups.
Make a new project which use CheckBox and RadioButton widgets together.