Exam 1 : Activities and Events
Develop an application that performs the following:
- Display a TextView and a Button with text "Restore".
- When the app is launched, the TextView should display the current system time in milliseconds.
- When the device orientation is changed, the text displayed in the TextView should be changed from the time at which the activity was started to the current orientation - Landscape or Portrait
- Use the method in Activity that returns the WindowManager instance, retrieve the default Device instance from the WindowManager and set the rotation.
- Do not use onConfigurationChanged to handle state across orientation changes.
- When the "Restore" button is clicked, the text displayed in the TextView should revert back to the original system time that was displayed.