现在总结一下Intent的用法:
1Intent 跳转时传递数据:传递txt文件的路径,文件名
Intent intent =new Intent (MainActivity.this,secondActivity.class);
Bundle bundle=new Bundle();
bundle.putString("filepath",currentFiles[position].getPath());
budle.putString("filename"currentFile[position].getName());
intent.putExtras(bundle);
startActivity(intent);
)
那么在secondAcitivty中:
/新页面接收数据 Bundle bundle = this.getIntent().getExtras();
String file_path=bundle.getString("filepath");
String file_name =bundle.getString("filename");