제가 지금 mediastore에서 값을 읽어와서
리스트에 뿌르고 있습니다.
근데 아티스트명에 따라 중복을 제거 하려고 하는데
어떻게 해야할까요
String[] artistcolumns = {
MediaStore.Audio.Media.ARTIST
};
cursor = null;
cursor = getActivity().getContentResolver().query(
MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
artistcolumns,
null,
null,
null);
while (cursor.moveToNext()){
infoClass = new InfoClass(
0,
0,
null,
null,
null,
cursor.getString(cursor
.getColumnIndex(MediaStore.Audio.Media.ARTIST)),
null);
artistArray.add(infoClass);
Collections.sort(artistArray, mComparator);
mAdapter = new GroupCustomAdapter(getActivity(), artistArray);
artistlist.setAdapter(mAdapter);
mAdapter.notifyDataSetChanged();
}
// Log.e("------------","==== 배열" + artistArray);
cursor.close();
array 형태는
public InfoClass(int _id, int data, String title, String name, String type, String artist, String album){
this._id = _id;
this.data = data;
this.title = title;
this.name = name;
this.type = type;
this.artist = artist;
this.album = album;
}
이런식으로 되어있습니다. 그중에 아티스트 부분만 쓴건데여 hash를 쓰든
contains 를 쓰든 리스트를 다 뿌려줍니다.. 중복제거 하려면 어떻게 해야할까요