How to save a string on android without "contains a path separator" ERROR

I get an error about a path separator. The code used to be "data/gun.txt" instead of "gun.txt" because of the error. Didn't fix it. I have tried another thread but it didn't work and this problem for some reason isn't asked often according to me not finding anything so can anyone help?

@kfrajer Hey I did some troubleshooting and somehow it started working? :) I used the same code (just "gun.txt") and it launched. So I don't know what was wrong with the code as it is around 800 lines long but anyways "gun.txt" and "guns/pistol.png" for images seem to work? Thanks for the help though :)

EDIT:

I did add the following code to the code because i saw someone else with it so maybe that fixed it idk because I'm new in android mode.