当前位置:   article > 正文

getSystemService使用汇总_getsystemserviceappops

getsystemserviceappops

getSystemService

使用案例

WifiManager wifiManager = (WifiManager)getSystemService(Context.WIFI_SERVICE);	
WifiManager wifiManager = (WifiManager)getSystemService("wifi");
  • 1
  • 2

部分Manager

Manager常量String
AccessibilityManagerACCESSIBILITY_SERVICEaccessibility
AccountManagerACCOUNT_SERVICEaccount
ActivityManagerACTIVITY_SERVICEactivity
AlarmManagerALARM_SERVICEalarm
AppWidgetManagerAPPWIDGET_SERVICEappwidget
AppOpsManagerAPP_OPS_SERVICEappops
AudioManagerAUDIO_SERVICEaudio
BatteryManagerBATTERY_SERVICEbatterymanager
BluetoothManagerBLUETOOTH_SERVICEbluetooth
CameraManagerCAMERA_SERVICEcamera
CaptioningManagerCAPTIONING_SERVICEcaptioning
CarrierConfigManagerCARRIER_CONFIG_SERVICEcarrier_config
ClipboardManagerCLIPBOARD_SERVICEclipboard
CompanionDeviceManagerCOMPANION_DEVICE_SERVICEcompaniondevice
ConnectivityManagerCONNECTIVITY_SERVICEconnectivity
ConsumerIrManagerCONSUMER_IR_SERVICEconsumer_ir
DevicePolicyManagerDEVICE_POLICY_SERVICEdevice_policy
DisplayManagerDISPLAY_SERVICEdisplay
DownloadManagerDOWNLOAD_SERVICEdownload
DropBoxManagerDROPBOX_SERVICEdropbox
FingerprintManagerFINGERPRINT_SERVICEfingerprint
HardwarePropertiesManagerHARDWARE_PROPERTIES_SERVICEhardware_properties
InputMethodManagerINPUT_METHOD_SERVICEinput_method
InputManagerINPUT_SERVICEinput
JobSchedulerJOB_SCHEDULER_SERVICEjobscheduler
KeyguardManagerKEYGUARD_SERVICEkeyguard
LauncherAppsLAUNCHER_APPS_SERVICElauncherapps
LayoutInflaterLAYOUT_INFLATER_SERVICElayout_inflater
LocationManagerLOCATION_SERVICElocation
MediaProjectionManagerMEDIA_PROJECTION_SERVICEmedia_projection
MediaRouterMEDIA_ROUTER_SERVICEmedia_router
MediaSessionManagerMEDIA_SESSION_SERVICEmedia_session
MidiManagerMIDI_SERVICEmidi
NetworkStatsManagerNETWORK_STATS_SERVICEnetstats
NfcManagerNFC_SERVICEnfc
NotificationManagerNOTIFICATION_SERVICEnotification
NsdManagerNSD_SERVICEservicediscovery
PowerManagerPOWER_SERVICEpower
PrintManagerPRINT_SERVICEprint
RestrictionsManagerRESTRICTIONS_SERVICErestrictions
SearchManagerSEARCH_SERVICEsearch
SensorManagerSENSOR_SERVICEsensor
ShortcutManagerSHORTCUT_SERVICEshortcut
StorageManagerSTORAGE_SERVICEstorage
StorageStatsManagerSTORAGE_STATS_SERVICEstoragestats
SystemHealthManagerSYSTEM_HEALTH_SERVICEsystemhealth
TelecomManagerTELECOM_SERVICEtelecom
TelephonyManagerTELEPHONY_SERVICEphone
TelephonyManagerTELEPHONY_SUBSCRIPTION_SERVICEtelephony_subscription_service
TextClassificationManagerTEXT_CLASSIFICATION_SERVICEtextclassification
TextServicesManagerTEXT_SERVICES_MANAGER_SERVICEtextservices
TvInputManagerTV_INPUT_SERVICEtv_input
UiModeManagerUI_MODE_SERVICEuimode
UsageStatsManagerUSAGE_STATS_SERVICEusagestats
UsbManagerUSB_SERVICEusb
UserManagerUSER_SERVICEuser
VibratorVIBRATOR_SERVICEvibrator
WallpaperManagerWALLPAPER_SERVICEwallpaper
WifiAwareManagerWIFI_AWARE_SERVICEwifiaware
WifiP2pManagerWIFI_P2P_SERVICEwifip2p
WifiManagerWIFI_SERVICEwifi
WindowManagerWINDOW_SERVICEwindow

TelephonyManager

作用

​ 管理手机通话状态

​ 获取电话信息(设备信息,sim卡信息以及网络信息)

​ 监听电话状态(呼叫状态服务状态,信号强度状态等)

​ 调用电话拨号器拨打电话

WindowManager

int h = windowManager.getDefauwltDisplay().getHeight();
int w = windowManager.getDefaultDisplay().getWidth();
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/589002
推荐阅读
相关标签
  

闽ICP备14008679号