Tap to delete alerts from DB built back in

This commit is contained in:
agk512 2013-12-02 21:11:56 -05:00
parent a71e43e12b
commit d4413c46fd

View File

@ -79,11 +79,12 @@ public class Home extends MenuActivity {
new ArrayAdapter<Alert>(this,android.R.layout.simple_list_item_1, alerts);
listView.setAdapter(adapter);
//tap to delete alert from list
//tap to delete alert from list and database
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
deleteAlert(alerts.get(position));
alerts.remove(alerts.get(position));
listView.setAdapter(adapter);
}