2019独角兽企业重金招聘Python工程师标准>>>
在AndroidManifest中定义
获取方法是
/*** * @param context* @param metaDataName 所定义的名称,相当于key* @return*/public static String getMetaDataValue(Context context, String metaDataName) {try {ApplicationInfo ai = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);if (ai.metaData != null) {return ai.metaData.getString(metaDataName);}} catch (PackageManager.NameNotFoundException e) {e.printStackTrace();return null;}return null;}