さまざまなコードを試しましたが、alert.dialogbox には常に問題があり、表示されません。簡単なコードを提案してください
1 に答える
1
private void alert(context,status,title,message)
{
Builder alertDialog = new AlertDialog.Builder(context);
// Setting Dialog Title
alertDialog.setTitle(title);
// Setting Dialog Message
alertDialog.setMessage(message);
if(status != null)
// Setting alert dialog icon, success and fail is an image
alertDialog.setIcon((status) ? R.drawable.success : R.drawable.fail);
// Setting OK Button
alertDialog.setPositiveButton("OK", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
}
});
// Setting Cancel Button
alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
}
});
// Showing Alert Message
alertDialog.show();
}
于 2013-07-26T15:57:03.053 に答える