Failing to open file, am I linking it wrong? Or is Android Studio not seeing it for some reason?

后端 未结 3 428
忘了有多久
忘了有多久 2021-01-27 12:09

I have a simple .txt file with just a couple lines in right now, each line has a word then a comma then another word, representing a very simplistic username , password bank. Fo

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-27 12:36

    You're referencing wrong to file in assets folder. It has to be smth like:

    file:///android_asset/myfoldername/myfilename
    

    in your particular case it's file:///android_asset/passwords.txt, though you have to keep in mind that it's always read only file

提交回复
热议问题