Please help me how to add custom List view\'s number of clicks to custom action bar (textview) in android?
Here is my Activity
Class
public
Ok so first of all declare a instance variable to keep the count of the clicks.
public int listViewClickCounter;
The on your listview onclick increment the count and call the change action bar method
yourListView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View view, int position,
long id) {
listViewClickCounter++
changeActionBarTitle();
}
});
Then implement the change action bar method. You said you have a custom view so you may need to change this a little
public void changeActionBarTitle() {
myActionBarCustomTitle.setText("number of clicks =" + String.valueOf(listViewClickCounter));