android 获取权限管理,Android常用权限获取和设置
Android常用權(quán)限獲取和設(shè)置
1 活動管理器
權(quán)限
代碼 ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
2 警報管理器
權(quán)限
代碼 AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
3 音頻管理器
權(quán)限
代碼 AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
4 剪貼板管理器
權(quán)限
代碼 ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
5 連接管理器
權(quán)限
代碼 ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
6 輸入法管理器
權(quán)限
代碼 InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
7 鍵盤管理器
權(quán)限
代碼 KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
8 布局解壓器管理器
權(quán)限
代碼 LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
9 位置管理器
權(quán)限
代碼 LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
10 通知管理器
權(quán)限
代碼 NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
11 電源管理器
權(quán)限
代碼 PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
12 搜索管理器
權(quán)限
代碼 SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
13 傳感器管理器
權(quán)限
代碼 SensorManager sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
14 電話管理器
權(quán)限
代碼 TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
15 振動器
權(quán)限
代碼 Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
16 墻紙
權(quán)限
代碼 WallpaperService wallpaperService = (WallpaperService) getSystemService(Context.WALLPAPER_SERVICE);
17 Wi-Fi管理器
權(quán)限
代碼 WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
18 窗口管理器
權(quán)限
代碼 WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
《新程序員》:云原生和全面數(shù)字化實踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的android 获取权限管理,Android常用权限获取和设置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c语言cin n1 n2,牛客等级之题N
- 下一篇: android studio安装教程博客