Correct Answer : Get Lastest Questions and Answer : Explanation: uring normal app use, the foreground activity is sometimes obstructed by other visual components that cause the activity to pause. For example, when a semi-transparent activity opens (such as one in the style of a dialog), the previous activity pauses. As long as the activity is still partially visible but currently not the activity in focus, it remains paused.
However, once the activity is fully-obstructed and not visible, it stops (which is discussed in the next lesson).
As your activity enters the paused state, the system calls the onPause() method on your Activity, which allows you to stop ongoing actions that should not continue while paused (such as a video) or persist any information that should be permanently saved in case the user continues to leave your app. If the user returns to your activity from the paused state, the system resumes it and calls the onResume() method.
Note: When your activity receives a call to onPause(), it may be an indication that the activity will be paused for a moment and the user may return focus to your activity. However, it's usually the first indication that the user is leaving your activity.
Question : Which of the following attributes is used to set an activity screen to landscape orientation?
Correct Answer : Get Lastest Questions and Answer : Explanation: If you want to have fixed orientation for your activities then you can use-
android:screenOrientation="portrait" as an attribute to that activity in that manifest. But if you want to set the orientation runtime depending upon what was the previous orientation while launching the application, you need to check for the previous orientation in onCreate() and then set it to that value programmatically there itself using setRequestedOrientation()
Question : What is not true about the AndroidManifest.xml file?
1. It declares the views used within the application
2. It declares user permissions the application requires
4. Since Android uses libraries licensed in various ways such as GPL, BSD, and LGPL, applications developed under Android are subject to the severest license, GPL