Android Open Source - Chit-Chat Alert Dialog Manager






From Project

Back to project page Chit-Chat.

License

The source code is released under:

GNU General Public License

If you think the Android project Chit-Chat 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.dhansiddh.chatmessenger;
/*  w  w  w . j av  a  2  s. c  o  m*/


import android.app.AlertDialog;
import android.app.Application;
import android.content.Context;
import android.content.DialogInterface;

public class AlertDialogManager {
  /**
   * Function to display simple Alert Dialog
   * @param context - application context
   * @param title - alert dialog title
   * @param message - alert message
   * @param status - success/failure (used to set icon)
   *          - pass null if you don't want icon
   * */
  public void showAlertDialog(Context context, String title, String message,
      Boolean status) {
    AlertDialog alertDialog = new AlertDialog.Builder(context).create();

    // Setting Dialog Title
    alertDialog.setTitle(title);
    // Setting Dialog Message
    alertDialog.setMessage(message);

    if(status != null)
      // Setting alert dialog icon
      alertDialog.setIcon((status) ? R.drawable.success : R.drawable.fail);
    alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int which) {
        
      }
    });

    // Showing Alert Message
    alertDialog.show();
  }
}




Java Source Code List

com.dhansiddh.chatmessenger.AlertDialogManager.java
com.dhansiddh.chatmessenger.BaseActivity.java
com.dhansiddh.chatmessenger.BirdGridFragment.java
com.dhansiddh.chatmessenger.BirdMenuFragment.java
com.dhansiddh.chatmessenger.CommonUtilities.java
com.dhansiddh.chatmessenger.ConnectionDetector.java
com.dhansiddh.chatmessenger.GCMIntentService.java
com.dhansiddh.chatmessenger.JSONParser.java
com.dhansiddh.chatmessenger.MainActivity.java
com.dhansiddh.chatmessenger.MainPage.java
com.dhansiddh.chatmessenger.MessageAdapter.java
com.dhansiddh.chatmessenger.MessageItem.java
com.dhansiddh.chatmessenger.MessageMainListAdapter.java
com.dhansiddh.chatmessenger.Register_Number.java
com.dhansiddh.chatmessenger.Register.java
com.dhansiddh.chatmessenger.SampleListFragment.java
com.dhansiddh.chatmessenger.ServerUtilities.java
com.dhansiddh.chatmessenger.WakeLocker.java