ボタンを作成しましたが、そのボタンをクリックすると新しいダイアログボックスが表示されます。このダイアログボックスでアイコンとtext.textは表示されますがアイコン(イメージ)はダイアログボックスに表示されません。 ここに私はあなたが空でない文字列でのsetTitleを呼び出す必要がありますDialogBoxでボタンをクリックしているときにアイコン(画像)を設定する方法
Button btnteam_westernbulldogs=new Button(this);
btnteam_westernbulldogs.setId(team_westernbulldogsid);
btnteam_westernbulldogs.setBackgroundResource(R.drawable.team_westernbulldogs);
public void onClick(View v){
createbtnteam_westernbulldogs();
}
});
public void createbtnteam_westernbulldogs()
{
AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setIcon(R.drawable.team_westernbulldogs);
alertDialog.setMessage("What kind of Banner do you Want to Create?");
alertDialog.setButton("Text", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
createText();
}
alertDialog.setIcon(R.drawable.icon);
alertDialog.show();
} });
屋、sir.Iはそれを得たのuに感謝します。 – Mercy