我必须完成一个列表视图,我被卡住了,有人可以帮我吗?我是初学者,我看不懂“ListAdapter”
谢谢
private void lista(){
SQLiteDatabase db = new MioDbHelper(this).getReadableDatabase();
String sql = "SELECT nome_utente_pc, password_pc, note_pc FROM Password";
Cursor c = db.rawQuery(sql, null);
ListAdapter adapter = new ArrayAdapter<>(this, R.layout.dettaglio_lista_pc){
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = super.getView(position, convertView, parent);
TextView tvUtente, tvPass, tvNote;
tvUtente = (TextView) row.findViewById(R.id.tv_utente_pc);
tvPass = (TextView) row.findViewById(R.id.tv_password_pc);
tvNote = (TextView) row.findViewById(R.id.tv_note_pc);
}
};
lista.setAdapter(adapter);
}