Correct Answer : Get Lastest Questions and Answer : Explanation: SensorManager lets you access the device's sensors. Get an instance of this class by calling Context.getSystemService() with the argument SENSOR_SERVICE.
Always make sure to disable sensors you don't need, especially when your activity is paused. Failing to do so can drain the battery in just a few hours. Note that the system will not disable sensors automatically when the screen turns off.
Question : Which of these is the incorrect explanation of the Toast class?
1. Toast is a simple class for display, and cannot be set with a custom XML-defined layout
2. The display duration time of Toast can be chosen from 2 types, LENGTHJjDNG and LENGTH_SHORT.
4. Since Toast automatically closes after display, a dismiss () method is not provided
Correct Answer : Get Lastest Questions and Answer : Explanation: A toast provides simple feedback about an operation in a small popup. It only fills the amount of space required for the message and the current activity remains visible and interactive. For example, navigating away from an email before you send it triggers a "Draft saved" toast to let you know that you can continue editing later. Toasts automatically disappear after a timeout.
If a simple text message isn't enough, you can create a customized layout for your toast notification. To create a custom layout, define a View layout, in XML or in your application code, and pass the root View object to the setView(View) method.