4

I would like to change the value of a meta-data in the AndroidManifest.xml file :

I am using the following code :

ApplicationInfo applicationInfo = packageManager.getApplicationInfo(
                activity.getPackageName(), PackageManager.GET_META_DATA);
applicationInfo.metaData.putString("dataName", "2");

But the applicationInfo is not saved into the package manager. When packageManager.getApplicationInfo() is called afterwards, I get the old value.

I didn't see a setApplicationInfo() method, how can I proceed ?

Thanks

Julien
  • 157
  • 1
  • 2
  • 6

2 Answers2

4

AFAIK, the applicationInfo that getApplicationInfo returns is always a copy and there are no apis to change metadata

nandeesh
  • 24,740
  • 6
  • 69
  • 79
2

This meta data can be only supplied from Manifest file and can not be changed after that(as pointed above it will always return a copy and even if update it in some component it will not get updated originally)