Hi people. Please help me ... I'm new to this. There is a ListView which is based on the list_row template. In list_row there are id (hidden), title and info fields. ID contains a unique number from the database. If I know the position of the item I need in the listview, how do I get the ID from the list_row I need this value. I get the position by long clicking on the item at which the context menu pops up with the delete button.
<ListView android:id=" @android :id/list" android:layout_width="fill_parent" android:layout_height="wrap_content"/>
list_row.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/list_selector" android:orientation="horizontal" android:padding="5dip" > <TextView android:id="@+id/id_item" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" /> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/thumbnail" android:layout_toRightOf="@+id/thumbnail" android:paddingBottom="2dp" android:paddingTop="6dp" android:text="Заголовок вопроса ... " android:textColor="#040404" android:textSize="13dip" android:textStyle="bold" android:typeface="sans" /> <TextView android:id="@+id/question" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below=" @id /title" android:layout_marginTop="1dip" android:layout_toLeftOf="@+id/date" android:text="Краткий вопрос ..." android:textColor="#343434" android:textSize="11dip" /> <TextView android:id="@+id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignTop=" @id /title" android:layout_marginRight="5dip" android:gravity="right" android:text="00.00.0000 00:00" android:textColor="#464b50" android:textSize="10dip" android:textStyle="bold" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignTop=" @id /question" android:layout_centerVertical="true" android:layout_marginRight="5dip" android:contentDescription="@string/star" android:src="@drawable/arrow" /> </RelativeLayout>