したがって、アプリケーションに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");
検索し、サウンドプールがそれを使用します。必要なのは、「SONGNAME」以外のEditTextTextを使用することだけです。