androidclick-counting

click count in Activities


My android app project need to add a new function of saving the click count of some view(such as button,picture, and so on) in my activities. how to settle this with proper way(in architecture view point)? should i override all the onClick()?


Solution

  • You should set an onclicklistener to the desired views, store the click count in a field and increment that field when the onClick() action occurs.