我想按产品名称对ListView的项目进行排序.我有一个名为"data"的向量,它是一种类.
我上课的是:
public static class RowData implements Comparable<RowData>{
public String mProductName;
protected int mId;
protected int mOnHand;
protected double mPrice;
protected boolean mIsColleaction;
protected boolean mIsPrePack;
RowData(int id ,String productName,int onhand,double price,boolean IsColleaction, boolean IsPrePack) {
mId= id;
mProductName= productName;
mOnHand =onhand;
mPrice = price;
mIsColleaction =IsColleaction;
mIsPrePack = IsPrePack;
}
@Override
public String toString() {
return mProductName;
}
public int compareTo(RowData other) {
return mProductName.compareTo(other.mProductName);
}
public static Comparator<RowData> COMPARE_BY_PRODUCTNAME = new Comparator<RowData>() {
public int compare(RowData one, RowData …Run Code Online (Sandbox Code Playgroud) 我已经像下面提到的链接一样做了图像的联系人列表,
http://deshmukhanil.blogspot.in/2012/02/wanted-to-create-fast-scrolling-with.html
但问题是,当我点击字母表列表时,租船人没有显示,只有当我滚动浏览"setFastScrollEnabled"但我不想在我的屏幕上显示"FastScroll"时才会显示:这里是显示内容的链接我想要,
http://deshmukhanil.blogspot.in/2012/02/wanted-to-create-fast-scrolling-with_09.html