所以我在我的应用程序中有 Preference EditText 并且我想从 EditText 获取该文本并将其用作此代码中的文件名String path = getFullFilePath(getApplicationContext(), filename);
我已经尝试过:
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);
LogCat 说:示例 1 尚未准备好
使用String path = getFullFilePath(getApplicationContext(), "SONG NAME");
在外部存储上查找歌曲,soundpool 使用它。我想要的只是使用 EditText Text,除了“SONG NAME”