读取第三方android应用的META值

//第三方android应用的META值

public  String getPackageMetaValue(Context context, String packageName, String key) {

ApplicationInfo appInfo =null;

String value =null;

try {

appInfo = context.getPackageManager()

.getApplicationInfo(packageName,

PackageManager.GET_META_DATA);

value = String.valueOf(appInfo.metaData.get(key));

}catch (PackageManager.NameNotFoundException e) {

e.printStackTrace();

}

return value;

}

推荐阅读更多精彩内容