Tap to delete alerts built.

This commit is contained in:
agk512
2013-11-21 15:52:23 -05:00
parent 1e19e763bd
commit 7471118550
3 changed files with 52 additions and 30 deletions

View File

@ -55,6 +55,10 @@ public class Alert {
this.shown = i;
}
public String toString() {
return this.message;
}
public void displayNotification(Context ctx) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx)
.setSmallIcon(R.drawable.ic_launcher)

View File

@ -83,6 +83,16 @@ public class AlertDB extends SQLiteOpenHelper {
return null;
}
//delete specified alert from DB
public void deleteAlert(Alert alert) {
SQLiteDatabase db = this.getWritableDatabase();
db.delete(TABLE_ALERTS, KEY_MESSAGE + " = ?",
new String[] { String.valueOf(alert.getMessage()) });
db.close();
}
//get all alerts from Database
//regardless of type, or if it has been shown