/** * @param fileName * @return assets中文件的字符串 */ public String getFromAssets(String fileName){ String result=""; try { InputStreamReader inputReader = new InputStreamReader( getResources().getAssets().open(fileName) ); BufferedReader bufReader = new BufferedReader(inputReader); String line=""; while((line = bufReader.readLine()) != null) { result += line; } } catch (Exception e) { e.printStackTrace(); } return result; }
时间: 2024-10-11 21:47:03