這是我的課:如何從靜態方法訪問/來電提示AlertDialog Box在我的活動
public class UTILS
{
public static void AlertssDialogBox(Context context,String Message)
{
AlertDialog.Builder alertDialog2 = new AlertDialog.Builder(context);
alertDialog2.setTitle("Error");
alertDialog2.setMessage(Message);
alertDialog2.setNegativeButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which)
{
}
});
alertDialog2.show();
}
}
在我的活動我調用類和靜態方法:
UTILS.AlertssDialogBox(getApplicationContext(),"Please Coonect Internet");
但顯示錯誤。
是它顯示了什麼錯誤? – Sdra