Back to project page texthem.
The source code is released under:
GNU General Public License
If you think the Android project texthem listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* Texthem: Massive SMS Sender for Android/*from www . java 2s. c o m*/ Copyright (C) 2014 Aarn Rosas Rodrguez aarr90@gmail.com This file is part of Texthem. Texthem is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Texthem is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Texthem. If not, see <http://www.gnu.org/licenses/>. */ package a2.marketingsms.components; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; public class DialogHandler { public Runnable ans_true = null; public Runnable ans_false = null; // Dialog. -------------------------------------------------------------- public boolean Confirm(Activity act, String Title, String ConfirmText, String CancelBtn, String OkBtn, Runnable aProcedure, Runnable bProcedure) { ans_true = aProcedure; ans_false = bProcedure; AlertDialog dialog = new AlertDialog.Builder(act).create(); dialog.setTitle(Title); dialog.setMessage(ConfirmText); dialog.setCancelable(false); dialog.setButton(DialogInterface.BUTTON_POSITIVE, OkBtn, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int buttonId) { if (ans_true != null) ans_true.run(); } }); if (CancelBtn != null) { dialog.setButton(DialogInterface.BUTTON_NEGATIVE, CancelBtn, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int buttonId) { if (ans_false != null) ans_false.run(); } }); } dialog.setIcon(android.R.drawable.ic_dialog_alert); dialog.show(); return true; } }