读取Android Assets文本文件中的内容

public String ReadTxtFile(String filename) {
		InputStream fis = null;
		try {
			fis = this.getResources().getAssets().open(filename);
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

		String result = "";
		try {
			result = streamRead(fis);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}// 返回一个字符串
		return result;
	}

你可能感兴趣的:(读取Android Assets文本文件中的内容)