// 读取文本中的数据,显示在TextView上
String res = "";
try {
InputStream in = getResources().openRawResource(R.raw.info_text);
int length = in.available();
byte[] buffer = new byte[length];
in.read(buffer);
res = EncodingUtils.getString(buffer, "Unicode");
in.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
tv.setText(res);
String res = "";
try {
InputStream in = getResources().openRawResource(R.raw.info_text);
int length = in.available();
byte[] buffer = new byte[length];
in.read(buffer);
res = EncodingUtils.getString(buffer, "Unicode");
in.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
tv.setText(res);