我得到一個editText,它允許用戶輸入文件名,但由於所有文件都在原始文件夾中。我試圖讓從原始文件夾中的文件,這裏的問題是,如何更改(R.raw.fileName)作爲fileName更改
String fileName = editText.getText().toString; InputStream ins = getResources().openRawResource(R.raw.my_db_file);
我怎能取代「my_db_file」,以文件名?似乎沒有讓我像這樣的代碼
InputStream ins = getResources().openRawResource(R.raw.fileName);
感謝這麼多的幫助
可能的重複[如何將openRawResource()中的fileName設置爲變量](http://stackoverflow.com/questions/9554265/how-to-set-the-filename-in-the-openrawresource-可變) – CommonsWare 2012-03-04 13:07:33