在AndroidManifest中先需要<meta-data>对name,value进行初步设置
try { ApplicationInfo appInfo = ctx.getPackageManager().getApplicationInfo(ctx.getPackageName(), PackageManager.GET_META_DATA); String value = appInfo.metaData.getString(key); return value; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); }