내 목록보기에 TextView를 추가하려고하지만 강제로 닫으면 강제 종료됩니다. 노래 앞에 노래 이름에 주먹 글자를 표시하려고합니다. songlist는 문자열 arraylist이며 이것은 모두 목록보기에 있습니다.TextView를 디바이더로 ListView에 추가
Collections.sort(songtitle);
TextView divide = (TextView)findViewById(R.layout.song);
adapter = new ArrayAdapter<String>(this,R.layout.song,songtitle);
int l= 0;
while(l < adapter.getCount()-1){
if(songtitle.get(l).charAt(0) == songtitle.get(l+1).charAt(0)){
adapter.add(songtitle.get(l));
}else{
String songname1 = songtitle.get(l);
String newString = songname1.substring(0,1);
divide.append(newString);// This is where i get the force close ... I want to display this textView ////
}
l++;
}
setListAdapter(adapter);
}
공유 errorLog. 또한 songtitle arrayList. –