我已设法获取手机上安装的所有动态壁纸列表。但我想获得安装在我的Android手机上的所有白日梦的列表。有人可以帮我解决一下我应该用来获取此列表的意图。
答案 0 :(得分:0)
此代码打印设备中可用的所有Daydream:
PackageManager packageManager = getPackageManager();
Intent dreamIntent = new Intent(DreamService.SERVICE_INTERFACE);
List<ResolveInfo> resolveInfoList = packageManager.queryIntentServices(dreamIntent, PackageManager.GET_META_DATA);
for (ResolveInfo resolveInfo : resolveInfoList) {
if (resolveInfo.serviceInfo == null) {
continue;
}
Log.d(TAG, String.valueOf(resolveInfo.loadLabel(packageManager)));
}