Android AlertDialog Create alert(Context act, int strId)

Here you can find the source of alert(Context act, int strId)

Description

alert

Declaration

public static void alert(Context act, int strId) 

Method Source Code

//package com.java2s;
import android.app.AlertDialog;
import android.content.Context;

public class Main {
    private static AlertDialog alert;

    public static void alert(Context act, int strId) {
        String msg = act.getResources().getString(strId);
        alert(act, msg);/*from w w  w.ja va 2 s.  c  om*/
    }

    public static void alert(Context act, String msg) {
        AlertDialog.Builder builder = new AlertDialog.Builder(act);
        builder.setMessage(msg);
        alert = builder.create();
        alert.show();
    }
}

Related

  1. showAlert(Context context, int titleId, int messageId, CharSequence positiveButtontxt, DialogInterface.OnClickListener positiveListener, CharSequence negativeButtontxt, DialogInterface.OnClickListener negativeListener)
  2. showAlert(Context parent, String alert)
  3. showAlertText(String alertText, Context context)
  4. showInfoDialog(Context context, String message, String titleStr, String positiveStr, DialogInterface.OnClickListener onClickListener)
  5. alert(Context act, String msg)
  6. showErrorDialog(Context context, int title, int message)
  7. showAlertDialog(Activity ctx, String title, String text)
  8. createAlertDialog(Context cx, String title, String message)
  9. alert(String title, String message, Context context)