0
我在這個項目上工作,但我不知道我怎麼可以顯示相反的列表視圖(升序)列表視圖升序排列在Android的
Artistlist類
public class Artistlist extends ArrayAdapter<Artist> {
private Activity context;
private List<Artist> artistList;
public Artistlist(Activity context,List<Artist> artistList){
super(context,R.layout.list_layout , artistList);
this.context = context;
this.artistList = artistList;
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
View listViewItem = inflater.inflate(R.layout.list_layout,null,true);
TextView textViewname = (TextView) listViewItem.findViewById(R.id.textView);
TextView textViewGener = (TextView) listViewItem.findViewById(R.id.textView2);
Artist artist = artistList.get(position);
textViewname.setText(artist.getArtistName());
textViewGener.setText(artist.getArtistGener());
return listViewItem;
}
}
如何是否可以反向顯示列表視圖(升序) 謝謝