Seekbar가 사용되고있는 뮤직 애플리케이션을 개발 중입니다. seekbar 성능을 처리하는 한 가지 방법이 있습니다. SeekBar를 행동에있는 경우 그러나, 거기에 메모리 누설과 로그 고양이는 검색 막대가Android TextView 메모리 누출
을 진행 때이 계속오고있다
GC_CONCURRENT freed 1692K, 34% free 10759K, paused 3ms+8ms
처럼 내가 문제가 텍스트 뷰의 그 갱신에 의한 것으로 나타났습니다 보여줍니다 현재 노래의 지속 시간을 표시하는 것입니다.
어떻게 해결할 수 있습니까? 이 문제에 대한 좀 도와주세요
내 기능을 사용하면 메모리 누수가 있음을 의미하지 않는다
public void seekbarProgress(){
handler.postDelayed(new Runnable() {
@Override
public void run() {
//current position of the play back
currPos = harmonyService.player.getCurrentPosition();
if(isPaused){
//if paused then stay in the current position
seekBar.setProgress(currPos);
//exiting from method... player paused, no need to update the seekbar
return;
}
//checking if player is in playing mode
if(harmonyService.player.isPlaying()){
//settting the seekbar to current positin
seekBar.setProgress(currPos);
//updating the cuurent playback time
currTime.setText(getActualDuration(""+currPos));
handler.removeCallbacks(this);
//callback the method again, wich will execute aftr 500mS
handler.postDelayed(this, 500);
}
//if not playing...
else{
//reset the seekbar
seekBar.setProgress(0);
//reset current position value
currPos = 0;
//setting the current time as 0
currTime.setText(getActualDuration(""+currPos));
Log.e("seekbarProgress()", "EXITING");
//exiting from the method
return;
}
}
}, 500);
}
왜 모든 seekbar 진행률로 트랙의 길이를 업데이트 하시겠습니까? MediaPlayer가 준비된 후 한 번 업데이트 할 수 있습니다. – Rotem
하나의 Textview에서 현재 검색 시간을 업데이트하려면 노래의 전체 재생 시간 동안 Textview가 하나 더 있어야합니다.이 텍스트 뷰는 재생중인 노래의 현재 시간을 나타냅니다. – AndEngine
얼마나 자주 seekbar 진행률을 변경합니까? 텍스트에 밀리 초를 표시하지 않으면 매 초마다 검색 막대에 따라 TextView를 업데이트하는 스레드를 만들 수 있습니다. – Rotem