0

I want to read activity metadata from another app. I have cole like this:

        PackageManager packageManager = getPackageManager();
        Intent intent = new Intent(MY_ACTION);

        List<ResolveInfo> pluginsInfo = packageManager.queryIntentActivities(intent, PackageManager.GET_RESOLVED_FILTER);

        for (ResolveInfo plugin : pluginsInfo) {
                ResolveInfo info = plugin;
                ActivityInfo aInfo = info.activityInfo;

                Bundle metadata = aInfo.metaData;
        }

And sometimes it works good, but sometimes metadata is null. On same emulator and same app version. Is there other way to do this?

Hagakurje
  • 1,002
  • 2
  • 11
  • 17

1 Answers1

0

And answer is simple: packageManager.queryIntentActivities(intent, PackageManager.GET_RESOLVED_FILTER | PackageManager.GET_META_DATA);

Hagakurje
  • 1,002
  • 2
  • 11
  • 17