I got a editText which allow the user the type the file name, but since all the files are in the raw folder. I try to get the file from the raw folder and here is the problem,
String fileName = editText.getText().toString;
InputStream ins = getResources().openRawResource(R.raw.my_db_file);
how can I replace “my_db_file” to fileName? it seems not allow me to code it like this
InputStream ins = getResources().openRawResource(R.raw.fileName);
thanks so much for the help
Files in the raw folder can’t be changed in the runtime. I don’t know why you need to ask the user to input the file name. As far as I know, it’s impossible to do so, since all the files in teh raw folder should be defined already before compilation.