简体   繁体   中英

How to get list of all daydreams installed on android phone

I have managed to get list of all live wallpapers installed on phone. But i would like to get the list of all daydreams installed on my android phone. Can someone please help me with the intent that i should use to get this list.

This code prints all the Daydream available in the device:

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)));
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM