Home Assignment 1 (due 05.10)
- Make sure your application takes care of lifecycle changes (the user's state, e.g. search results must not be lost e.g. when switching phone orientation)
- if you fail to meet this requirement you will receive a penalty of -5 pts
- Have an activity A, with design such as in figure A, presenting a list of the phones contacts (content provider, CursorAdapter) ( 10 pts)
- Selecting one contact opens up their details in a new activity B, providing means for sending e-mails, including EditTexts to capture a title and body for the e-mail ( 5 pts)
- Details: Full name, phone no., email
- Pressing the send e-mail button will forward an intent to send an e-mail, passing along relevant information (the recipient's e-mail, e-mail title, body) ( 5 pts)
- After hitting "send" in the e-mail app, activity B should handle the e-mail apps result (onActivityResult( ) ) and then immediately close itself, returning the user back to activity A,where a message next to the chosen contact appears indicating that an e-mail was composed for them (up to you how to display the message exactly).
- Use onActivityResult() to react to the e-mail app finishing.
- After hitting "send" in the e-mail app, activity B should handle the e-mail apps result (onActivityResult( ) ) and then immediately close itself, returning the user back to activity A,where a message next to the chosen contact appears indicating that an e-mail was composed for them (up to you how to display the message exactly).
Note: In the case of Gmail, you may receive Activity.RESULT_CANCELED as intent result. While this can be a bit confusing, you may ignore the fact that the result says "canceled". In any case, in your GreetingActivity, set the activity result to be RESULT_OK.
- The app should also have an action bar with working search functionality (search contact by name). ( 5 pts)