展会信息港展会大全

获取清单文件的meta data android开发教程
来源:互联网   发布日期:2016-01-19 12:26:31   浏览:1553次  

导读: ** * 获取清单文件张Meta-Data的Value值 * public static String getMetaValue(Context context, String metaKey) { if (context == null || metaKey ...

/**

* 获取清单文件张Meta-Data的Value值

*/

public static String getMetaValue(Context context, String metaKey) {

if (context == null || metaKey == null) {

return null;

}

try {

ApplicationInfo aiApplicationInfo = context.getPackageManager().getApplicationInfo(

context.getPackageName(), PackageManager.GET_META_DATA);

if (null != aiApplicationInfo) {

if (null != aiApplicationInfo.metaData) {

return aiApplicationInfo.metaData.getString(metaKey);

}

}

} catch (NameNotFoundException e) {

e.printStackTrace();

}

return null;

}

赞助本站

人工智能实验室

相关热词: meta data android开发

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港