Back to project page SoundScheduler.
The source code is released under:
GNU General Public License
If you think the Android project SoundScheduler listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Sound Scheduler// w w w. j ava2s. c o m * Copyright (C) 2013 Victor Kifer */ package com.victorkifer.SoundScheduler.listeners; import android.content.Intent; import android.util.Log; import android.view.View; import com.victorkifer.SoundScheduler.MainActivity; import com.victorkifer.SoundScheduler.database.RulesDataSource; import com.victorkifer.SoundScheduler.entities.Rule; public class RuleDeleteListener implements View.OnClickListener { private long id; public RuleDeleteListener(long id) { this.id = id; } public void updateId(long id) { this.id = id; } @Override public void onClick(View v) { Log.d("Listener", "Rule deleted"); RulesDataSource rulesDataSource = new RulesDataSource(v.getContext().getApplicationContext()); rulesDataSource.open(); Rule rule = new Rule(); rule.setId(id); rulesDataSource.deleteRule(rule); v.getContext().getApplicationContext().sendBroadcast(new Intent(MainActivity.ACTION_RULELIST_UPDATE)); rulesDataSource.close(); } }