android平台上,我用fileoutputstream?fos=new?fileoutputstream("/sdcard/1.txt");老是抛异常filenotfoundexception,但我用?fileoutputstream?fos=openfileoutput("1.txt")就可以,但不能指定路径,小白求大神讲解
------解决方案--------------------
操作存储卡是需要权限的,请加上
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
另外,存储卡的路径最好动态获取,不同手机会不一样。
Environment.getExternalStorageDirectory();