Here you can find the source of alert(Context act, int strId)
public static void alert(Context act, int strId)
//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(); } }