解析res资源的方法
AssetManager am = getAssets();
InputStreamReader isr = null;
try {
StringBuilder sb = new StringBuilder();
InputStream is = am.open("test.txt");
isr = new InputStreamReader(is);
char[] temp = new char[128];
while(isr.read(temp)!=-1){
sb.append(temp);
}
String str = sb.toString();
JSONObject jo = new JSONObject(str);
int id = jo.getInt("id");
LogM.log(this.getClass(), "得出的结果:"+id+"");
} catch (IOException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}finally{
if(isr==null){
try {
isr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}