这个名单有两个名字(迭戈和艾伦),它总是先显示迭戈 我已经尝试了许多不同的东西,但它们似乎都没有工作
public void mostrarusuarios() {
inicializarbase();
if (responder == true) {
Cursor cursor = basededatos.rawQuery("select * from Usuarios ", null);
if (cursor.moveToFirst()) {
listusers.add(cursor.getString(cursor.getColumnIndex("User")));
while (cursor.moveToNext()) {
listusers.add(cursor.getString(cursor.getColumnIndex("User")));
}
}
}
for (int i = 0; i < listusers.size(); i++) {
Toast.makeText(this, listusers.get(i), Toast.LENGTH_SHORT).show();
}
basededatos.close();
}
public void orderalphabetically() {
showusers();
Collections.sort(listusers, String.CASE_INSENSITIVE_ORDER);
for (int i = 0; i < listusers.size(); i++) {
Toast.makeText(this, listusers.get(i), Toast.LENGTH_SHORT).show();
}
}