Exercises

1. Add a logging tag to your Droid1 project. Within the onCreate() callback method, add an informational logging message, using the Log.i() method. Run the application and view the log results.

2. Implement some of the Activity callback methods in addition to onCreate(), such as onStart(), onRestart(), onResume(), onPause(), onStop(), and onDestroy(). Add a log message to each callback method and then run the application normally. View the log results to trace the application life cycle. Next, try some other scenarios, such as pausing or suspending the application and then resuming. Simulate an incoming call. Watch the application log to see how the activity responds to such events.

This page intentionally left blank

0 0

Post a comment