标签:
直接上代码,不用解释
<span style="font-size:18px;">ApplicationInfo appInfo = null; try { appInfo = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); } catch (NameNotFoundException e) { e.printStackTrace(); } if (appInfo.metaData != null) { String appid = appInfo.metaData.getString("PUSH_APPID"); String appsecret = appInfo.metaData.getString("PUSH_APPSECRET"); String appkey = (appInfo.metaData.get("PUSH_APPKEY") != null) ? appInfo.metaData.get("PUSH_APPKEY").toString() : null; Log.e(TAG,"appid="+appid); Log.e(TAG,"appsecret="+appsecret); Log.e(TAG,"appkey="+appkey); }</span>
android 教你怎么获取AndroidManifest.xml文件中的meta-data数据
标签:
原文地址:http://blog.csdn.net/coderinchina/article/details/43449023