///////리스트 뷰 클릭시
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3){
File fp = new File(STRSAVEPATH);
//해당 경로를 설정 후 저장된 파일 배열로 불러오기
File[] listFiles = fp.listFiles();
File REC_fp = new File(STRSAVEPATH+SAVEFILEPATH[position]);
play_ = readFile(REC_fp);
System.out.println(position);
System.out.println(listFiles.length);
System.out.println(play_.length);
for(a_ = 0; a_<=play_.length; a_+=9){
/////시간 정보
for(int b_ = 0; b_<8; b_++) Time[b_] = play_[a_+b_];
if(a_ == 0){
mSoundManager.playSound(SOUNDIDS[(int)play_[a_+8] - 63]);
}else{
try{
mThread = new Thread(new MyRunnable());
mThread.start();
}catch(Exception e){
}
}
for(int c_ =0 ; c_<8; c_++)
pre_Time[c_] = Time[c_];
}
}
class MyRunnable implements Runnable {
@Override
public void run() {
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
mSoundManager.playSound(SOUNDIDS[(int)play_[a_+8] - 63]);
}
}, bytesToLong(Time) - bytesToLong(pre_Time));
}
}
제가 버튼 클릭시 시간 정보와 버튼 정보를 저장해서 파일에 저장한 후 리스트 뷰에 파일목록을 뿌려 터치시 해당 저장 정보를 읽어와 재생을 하고싶습니다. 그런데 계속 딜레이까진 되는데 딜레이 후 mSoundManager.playSound(SOUNDIDS[(int)play_[a_+8] - 63]); 여기서 죽네요ㅠㅠ 초보라 로그켓을 봤는데 핸들어 문제라는데 정확하게 잘 모르겠습니다 ㅠㅠ
도와주세요 로그캣 에러입니다
04-03 10:47:23.225: E/AndroidRuntime(9248): FATAL EXCEPTION: main
04-03 10:47:23.225: E/AndroidRuntime(9248): Process: com.example.portablemusicstudio, PID: 9248
04-03 10:47:23.225: E/AndroidRuntime(9248): java.lang.ArrayIndexOutOfBoundsException: length=36; index=44
04-03 10:47:23.225: E/AndroidRuntime(9248): at com.example.portablemusicstudio.FileListActivity$MyRunnable$1.run(FileListActivity.java:180)
04-03 10:47:23.225: E/AndroidRuntime(9248): at android.os.Handler.handleCallback(Handler.java:739)
04-03 10:47:23.225: E/AndroidRuntime(9248): at android.os.Handler.dispatchMessage(Handler.java:95)
04-03 10:47:23.225: E/AndroidRuntime(9248): at android.os.Looper.loop(Looper.java:145)
04-03 10:47:23.225: E/AndroidRuntime(9248): at android.app.ActivityThread.main(ActivityThread.java:5834)
04-03 10:47:23.225: E/AndroidRuntime(9248): at java.lang.reflect.Method.invoke(Native Method)
04-03 10:47:23.225: E/AndroidRuntime(9248): at java.lang.reflect.Method.invoke(Method.java:372)
04-03 10:47:23.225: E/AndroidRuntime(9248): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
04-03 10:47:23.225: E/AndroidRuntime(9248): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)