So I have Preference EditText in my application and i Want to get that text from EditText and use it as filename in this code String path = getFullFilePath(getApplicationContext(), filename); I’ve tried this :
SharedPreferences getPrefs = PreferenceManager
.getDefaultSharedPreferences(getBaseContext());
SharedPreferences settings = getSharedPreferences("EditText",0);
String zipStr = settings.getString("ime", "");
sp = new SoundPool(5, AudioManager.STREAM_MUSIC, 0);
String path = getFullFilePath(getApplicationContext(), zipStr);
mSoundId = sp.load(path, 1);
And LogCat says : Sample 1 is not READY
using String path = getFullFilePath(getApplicationContext(), "SONG NAME"); Finds song on external storage and soundpool uses it.. All i want is use EditText Text except “SONG NAME”
Have you confirmed that you have a file with the name that’s stored in your pref? Add
Log.d("TAG", "Path: " + path)after yourString path = getFullFilePath(getApplicationContext(), zipStr);line and see what your path string actually contains and that you actually have a file at that location with that name.