我想要检索特定应用所需的服务。我写这段代码
pm = context.getPackageManager();
try {
pkgInfo = pm.getPackageInfo(packageName, PackageManager.GET_SERVICES);
requireService = pkgInfo.services;
if(requireService != null) {
for(int i=0; i<requireService.length; i++) {
services = requireService[i];
}
mytextview.setText(services.toString());
}
} catch (NameNotFoundException e) {
}
当我执行此代码时,我得到了服务但是这样:“ServiceInfo {422c12b8 com.package.name.serviceName}”
它是什么“ServiceInfo {422c12b8”,我怎么能删除它?另一个错误是,如果应用程序需要多个服务,我也只显示一项服务。