![](/img/trans.png)
[英]“App not installed” on device error from debug apk, “File appears to be corrupt”
[英]Files not saving if app is installed from APK
如果我的應用程序是通過APK安裝的,則不會將文件保存在內部存儲中,但是如果是通過IDE與adb一起安裝的,它會保存。 由Build / Build APK生成的APK
我解決了這個問題。 不知道為什么,但是當我使用時
FileOutputStream fos = new FileOutputStream(file);
它沒有工作,但是當我更改為:
FileOutputStream fos = context.openOutputStream("file.txt", Context.MODE_PRIVATE);
工作正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.