Olá,
O criei o list_view.xml dentro da pasta layout porém o Android Studio não reconhece quando declaro ele no meu ListaActivity
list_view.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_height="wrap_content" android:layout_width="match_parent">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/person"
android:id="@+id/item_foto"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/item_nome"
android:text="Nome"
android:textSize="20sp"
android:textStyle="bold"
android:paddingLeft="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/item_telefone"
android:text="Telefone"
android:textSize="12sp"
android:paddingLeft="10dp"
android:paddingTop="8dp"/>
</LinearLayout>
</LinearLayout>
Funcao Carrega lista
private void carregaLista() {
AlunoDao alunoDao = new AlunoDao(this);
List<Aluno> alunos = alunoDao.buscaAlunos();
alunoDao.close();
ArrayAdapter<Aluno> adapter = new ArrayAdapter<Aluno>(this, android.R.layout.tgea, alunos);
listaAlunos.setAdapter(adapter);
}