public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   Tag t = tagManager.get(position);
   if (tags.contains(t)) tags.remove(t);
   else tags.add(t);
   Log.d(TAG, "Click: " + tags.size());
   tagsChanged(true);
 }
 @Override
 public boolean onTouch(View view, MotionEvent event) {
   if (view.getId() == R.id.tag_cloud_view) {
     Log.d(TAG, "onTouch");
     float x = event.getX();
     float y = event.getY();
     Tag t = tagCloud.findTagAt(x, y);
     if (t != null) {
       if (tags.contains(t)) tags.remove(t);
       else tags.add(t);
       tagsChanged(true);
     }
   }
   return false;
 }
 @Override
 public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
   if (parent == tagList.getAdapterView()) {
     Log.d(TAG, "Long click: " + tags.size());
     tag = tagManager.get(position);
     showDialog(DIALOG_EDIT_TAG);
     return true;
   }
   return false;
 }
 public boolean onKey(View v, int keyCode, KeyEvent event) {
   // If the event is a key-down event on the "enter" button
   Log.v(TAG, "onKey " + keyCode);
   EditText text = (EditText) v;
   if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
     Tag t = tagManager.newTag(text.getText().toString());
     tags.add(t);
     tagsChanged(false);
     return true;
   }
   return false;
 }
 protected void updateStatusBar() {
   String msg = getString(R.string.tag_list_status, tags.size(), tags.allTags().size());
   status.setText(msg);
 }