Android Open Source - bodyguard Alert Dialog Manager






From Project

Back to project page bodyguard.

License

The source code is released under:

GNU General Public License

If you think the Android project bodyguard 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.example.bodyguard;
/*from w  w w . j  av  a 2s.co m*/
import android.app.AlertDialog;
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);

    // Setting OK Button
    alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int which) {
      }
    });

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




Java Source Code List

.BodyGuardActivity.java
com.example.bodyguard.AlertDialogManager.java
com.example.bodyguard.CommonUtilities.java
com.example.bodyguard.ConnectionDetector.java
com.example.bodyguard.CustomGeoCoding.java
com.example.bodyguard.DirectionsJSONParser.java
com.example.bodyguard.GPSTracker.java
com.example.bodyguard.GcmBroadcastReceiver.java
com.example.bodyguard.GcmIntentService.java
com.example.bodyguard.MainActivity.java
com.example.bodyguard.PlaceAutoComplete.java
com.example.bodyguard.PlaceDetails.java
com.example.bodyguard.Place.java
com.example.bodyguard.PlacesAutoCompleteAdapter.java
com.example.bodyguard.PlacesList.java
com.example.bodyguard.PollQRT.java
com.example.bodyguard.ResultActivity.java
com.example.bodyguard.SendLocationActivity.java
com.example.bodyguard.SplashScreen.java
com.example.bodyguard.StartActivity.java
com.example.bodyguard.UserInformation.java
com.example.bodyguard.WakeLocker.java