I have an issue which I can't seem to solve. I have a ListView , this ListView contains an object ( IndividualRow ). this IndividualRow has 3 values which are displayed in textviews and in a switch. These IndividualRows are stored in an ArrayList , but then I got stuck.

I want to press on 1 of the TextViews (which is displaying a temperature), when I press it, it should automatically add 1.

Now the problem is that I don't know how to implement this. I tried several things but I cound't figure it out. I don't specifically want code, but I'd like to know what I should do, so I'll not copy past and don't learn from it. This is my code so far.

(I have a custom adapter so that the ListView displays my rows accordingly, i can include it here if you want)

list_item.xml (this is how a row looks like)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:paddingTop="14dp" android:paddingBottom="14dp" > <Switch android:id="@+id/switch1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:height="30dp" android:textSize="22sp" android:textOff="@string/Off" android:textOn="@string/On" android:paddingLeft="30dp" /> <TextView android:id="@+id/tijd" android:textSize="22sp" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:clickable="true"/> <TextView android:id="@+id/temperatuur" android:textSize="22sp" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:clickable="true"/> <TextView android:layout_width="wrap_content" android:textSize="22sp" android:layout_height="wrap_content" android:text="@string/GradenCelcius" android:paddingRight="10dp" /> </LinearLayout>

This is the IndividualRow code

//holds values for each individual row public class IndividualRow { //instance variables private String tijd; private int temperatuur; private boolean onoroff2; //constructor > what an individual row needs to be an individual row public IndividualRow(String data1,int data2, boolean onoroff){ tijd = data1; temperatuur = data2; onoroff2 = onoroff; } //sends value of tijd public String getString1(){ return tijd; } //sends value of temperatuur public String getString2(){ String x = Integer.toString(temperatuur); return x; } //sends value of switch state, so on or off (on = true, off = false) public boolean getBoolean() { return onoroff2; } //probably should add setString1 and so on here right? }

And than here is my fragment which should operate it all