Android's Getsystemservice detailed

Source: Internet
Author: User

Android background running in a lot of service, they are systemserver on when the system starts, support the normal operation of the system, such as Mountservice Monitoring for SD card installation and removal, Clipboardservice provides the Clipboard function, Packagemanagerservice provides installation removal and viewing of packages, and so on, applications can access the data provided by the service through the manager interface provided by the system.

Getsystemservice is an important API for Android, a method of activity that obtains the corresponding object based on the name passed in, and then translates it into the appropriate service object. The following describes the system's corresponding services.

The name passed in The returned object Description
Window_service WindowManager To manage open Windows programs
Layout_inflater_service Layoutinflater Gets the view defined in the XML
Activity_service Activitymanager Managing the system state of an application

Power_service

Powermanger Service of power supply
Alarm_service Alarmmanager Services for the alarm clock

Notification_service

Notificationmanager Service for status bar
Keyguard_service Keyguardmanager Service for keyboard lock
Location_service Locationmanager Location of the service, such as GPS
Search_service Searchmanager Search for services
Vebrator_service Vebrator Mobile phone Shake Service
Connectivity_service Connectivity Network-connected Services
Wifi_service Wifimanager Wi-Fi Service
Telephony_service Teleponymanager Telephone service

注意:getSystemService这个方法基于context,只有存在TextView控件的窗体中这个方法才会被激活~

Android's Getsystemservice detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.