title: Android touch screen listener problem
body: <p>i've created this little program to show the user the fingers on the screen, but the problem is that the X,Y values from the other fingers are not being modified. What am I doing wrong?</p>
  
  <p>Thank you!</p>
  
  <pre><code>public class TestandoActivity extends Activity implements OnTouchListener {
  /** Called when the activity is first created. */
  private TextView txtV;
  private TextView txtV2;
  private int nf = 0;
  private Map&lt;Integer, String&gt; info;
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      info = new HashMap&lt;Integer, String&gt;();
  
      setContentView(R.layout.main);
      this.txtV = (TextView)this.findViewById(R.id.textview);
      this.txtV2 = (TextView)this.findViewById(R.id.textview2);
      this.txtV.setOnTouchListener(this);
  }
  
  public boolean onTouch(View v, MotionEvent event) {     
      int actionCode = event.getAction() &amp; MotionEvent.ACTION_MASK;
      int pid = event.getAction() &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT;
  
      info.put(pid, pid + ": X=" + event.getX() + " Y=" + event.getY() + " pressure=" + event.getPressure() + " size=" + event.getSize());
  
      if (actionCode == MotionEvent.ACTION_POINTER_UP || actionCode == MotionEvent.ACTION_UP)
          info.remove(pid);
  
      String total = "";
      for (Map.Entry&lt;Integer, String&gt; e : this.info.entrySet()) {
          total += e.getValue() + "\n";
      }
  
      this.txtV2.setText(total);
  
  
      return true;
  }
  }
  </code></pre>