title: Android delete list item from cursor adapter
body: <p>I already implemented CursorAdapter to show phone contact list, it works fine. Now I want to implement delete item on click.. But item will delete from only list, not from phone data base.. and delete function will implement in CursorAdapter. Tried but unable to do this.. Help me..</p>
  
  <p>My code is here..</p>
  
  <pre><code>ImageButton remFrnd = (ImageButton) view.findViewById(R.id.remove_frnd);
  remFrnd.setOnClickListener(new View.OnClickListener() {
  
      @Override
      public void onClick(View arg0) {
          Animation fadeOut = AnimationUtils.loadAnimation(context, R.anim.request_animate);
  
          fadeOut.setAnimationListener(new AnimationListener() {
  
              @Override
              public void onAnimationStart(Animation animation) {}
  
              @Override
              public void onAnimationRepeat(Animation animation) {}
  
              @Override
              public void onAnimationEnd(Animation animation) {
  
                  /////////////////////////////////////////////////////////////////////////// 
                  //final int position = listContacts.getPositionForView((View) view.getParent());
                  // datalist.remove(position);
                  deleteRecordWithId(itemId);
                  cursor.requery();
                  // myAdapter.notifyDataSetChanged();
                  /////////////////////////////////////////////////////////
                  notifyDataSetChanged();
              }
          });
  
          view.startAnimation(fadeOut);
      }
  }
  </code></pre>