Android 2.2 adds an android. app. admin. the deviceadmininfo class can help us obtain a package information with the Administrator permission. The deviceadmininfo class has a constructor called deviceadmininfo (context, resolveinfo receiver) to instantiate this class. The parameter is the context of the target packagemanager.
Activityinfo getactivityinfo () obtains the activity information of the context and returns an activityinfo object.
Componentname getcomponent () // obtain the component name of the package
String getpackagename () // obtain the package name of the APK package
String getreceivername () // returns the names of all schedulers.
String gettagforpolicy (INT policyident) // return some defined tags. Here we define uses_policy_force_lock, uses_policy_limit_password, uses_policy_reset_password, expiration, and uses_policy_wipe_data.
Charsequence loaddescription (packagemanager pm) // load the description of a package
Drawable loadicon (packagemanager pm) // here, android123 prompts the recommended method for obtaining the icon in APK file 2.2.
Charsequence loadlabel (packagemanager pm) // obtain the software name
Boolean usespolicy (INT policyident) // for parameter definitions, refer to gettagforpolicy
This article is transferred from Www.35java.com