@@ -0,0 +1,1304 @@
+package com.sgf.listeners;%0D%0A%0D%0Aimport java.util.List;%0D%0A%0D%0Aimport android.content.Context;%0D%0Aimport android.view.View;%0D%0Aimport android.view.View.OnClickListener;%0D%0A%0D%0Aimport com.sgf.adapters.FAVViewListItem;%0D%0Aimport com.sgf.database.ArticleDAO;%0D%0Aimport com.sgf.pojo.Article;%0D%0A%0D%0Apublic class DeleteArticleButton implements OnClickListener%7B%0D%0A%09%0D%0A%09private List%3CArticle%3E _article_list;%0D%0A%09private List%3CLong%3E _article_to_delete_list;%0D%0A%09private ArticleDAO _article_dao;%0D%0A%09private Context _c;%0D%0A%09private FAVViewListItem _adapter;%0D%0A%09%0D%0A%09public DeleteArticleButton(List%3CArticle%3E article_list, List%3CLong%3E article_to_delete_list, Context c, FAVViewListItem adapter)%7B%0D%0A%09%09_article_list = article_list;%0D%0A%09%09_article_to_delete_list = article_to_delete_list;%0D%0A%09%09_c = c;%0D%0A%09%09_adapter=adapter;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public void onClick(View v) %7B%0D%0A%09%09_article_dao = new ArticleDAO(_c);%0D%0A%09%09_article_dao.open(true);%0D%0A%09%09%0D%0A%0D%0A%09%09//delete all the checked elements in database%0D%0A%09%09for(int i=0;i%3C_article_to_delete_list.size();i++)%7B%0D%0A%09%09%09_article_dao.deleteArticleById(_article_to_delete_list.get(i));%0D%0A%09%09%7D%0D%0A%09%09%0D%0A%09%09//clear old lists%0D%0A%09%09_article_to_delete_list.clear();%0D%0A%09%09_article_list.clear();%0D%0A%09%09%09%0D%0A%09%09//rebuild the item list%0D%0A%09%09_article_list = _article_dao.getAllArticles();%0D%0A%09%09_article_dao.close();%0D%0A%09%09%0D%0A%09%09_adapter.notifyDataSetChanged();%0D%0A%09%7D%0D%0A%7D%0D%0A

Delete Image Button