e=bufferedReader.readLine())!=null)? { content.append(dataReadFromFile); }? }РР捕获读取过程中可能发生的异常并处理,在方法的最后把读取到的数据返回Рcatch (Exception e)? {? e.printStackTrace();? }? finally {? if(bufferedReader!=null)? {? try {? bufferedReader.close();? } catch (IOException e) {? e.printStackTrace();? }? }? }? return content.toString();РР在onCreate()方法中调用onload(),让activity在启动时就读取文件中的数据? protected void onCreate(Bundle savedInstanceState) {? super.onCreate(savedInstanceState);? setContentView(R.layout.activity_main);? TextView textView=(TextView)findViewById(R.id.textview);? textView.setText(load());