[Android Studio] cristaccio85:
Hi, i'm very very very messed up. Ok let's explain. I want create listview using this layout code.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">

<ImageView
android:layout_width="65dp"
android:layout_height="65dp"
android:id="@+id/imgpez"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_alignParentLeft="true"
android:src="@mipmap/ic_launcher" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="CODICE SAG"
android:textColor="#000000"
android:layout_marginLeft="30dp"
android:id="@+id/txtcodsag"
android:layout_marginTop="40dp"
android:layout_toRightOf="@+id/imgpez"
android:layout_toEndOf="@+id/imgpez" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="CODICE OE"
android:id="@+id/txtcodoe"
android:textColor="#000000"
android:layout_marginLeft="30dp"
android:layout_marginTop="40dp"
android:layout_toRightOf="@+id/imgpez"
android:layout_toEndOf="@+id/imgpez" />

<ImageView
android:layout_width="65dp"
android:layout_height="65dp"
android:id="@+id/imgdesc"
android:layout_marginTop="20dp"
android:layout_marginLeft="30dp"
android:layout_toRightOf="@+id/txtcodoe"
android:layout_toEndOf="@+id/txtcodoe"
android:src="@mipmap/ic_launcher" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="N"
android:id="@+id/txtN"
android:layout_marginTop="40dp"
android:textColor="#000000"
android:layout_marginLeft="30dp"
android:layout_toRightOf="@+id/imgdesc"
android:layout_toEndOf="@+id/imgdesc" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="CS-CT"
android:id="@+id/txtCSCT"
android:layout_marginTop="40dp"
android:textColor="#000000"
android:layout_marginLeft="30dp"
android:layout_toRightOf="@+id/txtN"
android:layout_toEndOf="@+id/txtN" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="A"
android:id="@+id/txtA"
android:textColor="#000000"
android:layout_marginTop="40dp"
android:layout_marginLeft="30dp"
android:layout_toRightOf="@+id/txtCSCT"
android:layout_toEndOf="@+id/txtCSCT" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="B"
android:id="@+id/txtB"
android:textColor="#000000"
android:layout_marginTop="40dp"
android:layout_marginLeft="30dp"
android:layout_toRightOf="@+id/txtA"
android:layout_toEndOf="@+id/txtA" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dettagli"
android:textColor="#000000"
android:id="@+id/apridettagli"
android:layout_alignBottom="@+id/imgdesc"
android:layout_toRightOf="@+id/txtB"
android:layout_toEndOf="@+id/txtB" />

</RelativeLayout>

This is layout: [IMG="Layout"]http://i.stack.imgur.com/k2gWZ.png[/IMG]

How can i build a listview from database with item clickable? Each item contains a specific id to select from database and show into a dialogbox.

Table fields:

[IMG="Table fields"]http://i.stack.imgur.com/YAMEX.png[/IMG]

id(for item clickable to open in a dialogbox for showing details) descrizione (description) text imgdescrizione (imgdescription) and imgpezzo (imgpiece) are name of image to pick from drawable folder. from codsag to cod_marca are text.

How can i load specific image into a listview? In the layout image ou can see my few drawable items.

I'm first time of developing android...and i would learn from you!!

Good morning and thanks...

Cris