ApplicationInfo metadata returning null

Tags: , ,

I have the following code:

In the manifest:

    android:value="@string/facebookApplicationId" />

In the code:

ApplicationInfo ai = getPackageManager().getApplicationInfo(
        getPackageName(), PackageManager.GET_META_DATA);
if (ai.metaData != null) {

But the result is ai.metaData==null. Why is this happening


From the latest android doc, <meta-data> can be only contained in <activity>/<activity-alias>/<service>/ <receiver>. So you should append meta-data in these components, not in <application> directly.

Source: stackoverflow