This code will display the dialog box with “Hello World” but I want to display an
image like :
also in the same dialog box.
can anyone help me?
private void showDialog(String message)
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Hello World");
builder.setCancelable(false);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
{
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
Here is the link which will get you to the tutorial about how to do this…
http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog
Enjoy!
Advice:
Search this website you can find most of basic fundamentals
http://developer.android.com
Suggestion:
HIT four time space bar before writing any code…it will attract more people to answer your question as it will look well written
Happy Coding!