Android Open Source - myToDo Alert Util






From Project

Back to project page myToDo.

License

The source code is released under:

Apache License

If you think the Android project myToDo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.gutspot.apps.android.mytodo.utils;
/*from  w w  w.j  a  va  2 s.c o m*/
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Build;

public final class AlertUtil {
    public static void show(Context context, String message, String yesLabel,
            DialogInterface.OnClickListener yesListener, String noLabel, DialogInterface.OnClickListener noListener) {
        AlertDialog dialog = new AlertDialog.Builder(context).create();
        dialog.setTitle("????");
        dialog.setMessage(message);
        dialog.setIcon(android.R.drawable.ic_dialog_alert);

        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
            dialog.setButton(DialogInterface.BUTTON_POSITIVE, yesLabel, yesListener);
            dialog.setButton(DialogInterface.BUTTON_NEGATIVE, noLabel, noListener);
        } else {
            dialog.setButton(DialogInterface.BUTTON_POSITIVE, noLabel, noListener);
            dialog.setButton(DialogInterface.BUTTON_NEGATIVE, yesLabel, yesListener);
        }

        dialog.show();
    }
}




Java Source Code List

com.gutspot.apps.android.mytodo.MainActivity.java
com.gutspot.apps.android.mytodo.MemoActivity.java
com.gutspot.apps.android.mytodo.ToDoActivity.java
com.gutspot.apps.android.mytodo.adapter.MemoAdapter.java
com.gutspot.apps.android.mytodo.adapter.ToDoAdapter.java
com.gutspot.apps.android.mytodo.dao.AbstractDAO.java
com.gutspot.apps.android.mytodo.dao.MemoDAO.java
com.gutspot.apps.android.mytodo.dao.NoticeDAO.java
com.gutspot.apps.android.mytodo.dao.ToDoDAO.java
com.gutspot.apps.android.mytodo.dialog.DateTimeDialog.java
com.gutspot.apps.android.mytodo.dialog.MemoOptionsDialog.java
com.gutspot.apps.android.mytodo.dialog.ToDoOptionsDialog.java
com.gutspot.apps.android.mytodo.model.AbstractEntity.java
com.gutspot.apps.android.mytodo.model.Memo.java
com.gutspot.apps.android.mytodo.model.Notice.java
com.gutspot.apps.android.mytodo.model.ToDo.java
com.gutspot.apps.android.mytodo.utils.AlertUtil.java
com.gutspot.apps.android.mytodo.utils.DBOpenHelper.java
com.gutspot.apps.android.mytodo.utils.DateTimeUtil.java