目录

How do I obtain the UIAbility name of the current application?

You can use getBundleInfoForSelf(), with bundleFlags set to at least GET_BUNDLE_INFO_WITH_HAP_MODULE and GET_BUNDLE_INFO_WITH_ABILITY, of bundleManager to obtain AbilityInfo of the application. AbilityInfo contains information such as the ability name and bundle name of the application.