public static String getString(Context context, String fileName, String key) {
Properties pro = new Properties();
try {
InputStream is = context.getAssets().open(fileName);
if (is == null) {
return null;
}
pro.load(is);
String channel_id = pro.getProperty(key);
if (TextUtils.isEmpty(channel_id)) {
return null;
}
return channel_id;
} catch (Exception e) {
}
return null;
}
//读取drawable,string,layout,dimen等的id
//resName对应的键名或者id
getApplicationContext().getResources().getIdentifier(resName, "drawable", mPackageName)