How to display an image in the dialog box
source link: https://www.codesd.com/item/how-to-display-an-image-in-the-dialog-box.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How to display an image in the dialog box
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!
Related Articles
I want to change the background image of the dialog box
How to display an image in the body of the email?
How to display an image from the drop-down list on the navigation menu bar
Android: click on the image in camera and display the image in the dialog box
how to set the image in the dialog box in c ++ Win32 API?
How to display an image in p: Dialog from a database
How to display an image in the image control of which image path is stored in the database when the user selects a value from the drop-down list in asp.net?
how to display multiple images from the database to the blade view, by Laravel 5.3?
How to display an image of the latest publication in wordpress
How to display an image in the upper right corner of an input box
How to display og: image given the URL of a page
How to display an image of the database on the JSP page
How to display separate images for the desktop and mobile browser using CSS?
How to set the icon (image) in the dialog box while clicking on the button event
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK