October 2018
Intermediate to advanced
464 pages
15h 17m
English
Our activity layout will consist of just a ToggleButton to control the flashlight mode. We'll be using the same setTorchMode() code as the Lights, Action, and Sound - getting the user's attention! recipe presented earlier, and will add a Heads-Up Notification. We'll need permission to use the vibrate option, so start by opening the Android Manifest and following these steps:
<uses-permission android:name="android.permission.VIBRATE"/>
<activity android:name=".MainActivity"
android:launchMode="singleInstance">