31

How to display an image in the dialog box

 2 years ago
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.
neoserver,ios ssh client

How to display an image in the dialog box

advertisements

This code will display the dialog box with "Hello World" but I want to display an image like :

Hqf4F.jpg
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

this is the main activity <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_widt

How to display an image in the body of the email?

Note: I don't want to attach the Image to the Email I want to show an image in the email body, I had tried the HTML image tag <img src=\"http://url/to/the/image.jpg\">" and I got output as you can see in this my question on How to add

How to display an image from the drop-down list on the navigation menu bar

In magento, can we display an image in navigation menu bar? I have tried as suggested in http://inchoo.net/ecommerce/magento/how-to-add-static-blocks-to-main-navigation-dropdown/, But this works for the default menu of magento. I have modified my nav

Android: click on the image in camera and display the image in the dialog box

i m using a custom dialog with an ImageView and 2 Button. first button to pick image from gallery second button to click image from camera i want to show the image in the ImageView of the dialog.. btn1.setOnClickListener(new View.OnClickListener() {

how to set the image in the dialog box in c ++ Win32 API?

i have developing a C++ Api project. i will use dialogboxparam to create a dialogbox... i done to create and set the textbox,labels and buttons... its work fine... now i want to add a image in the top of the dialogbox... i did use this code in WM_INI

How to display an image in p: Dialog from a database

I'm using primefaces to show a datable : I have a column in my datable , it's an image , what i want is when i clic in the image , a p:dialog show the image with a big dimension . I did it but the p:dialog show the wrong image, it shows the image of

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?

I have a database which is shown below in the image : Image of database Here is the image of the form : Image of the Form In this form i want to show up the image in image control of which image path is stored up in database and according to subcateg

how to display multiple images from the database to the blade view, by Laravel 5.3?

I have a multiple images in "Images" column in DB, and I need to display all Images in: @foreach(explode(',', $posts->images) as $images) <div class="col-lg-2 col-md-2 col-sm-2"> <a href="{{ URL::to('img/offers/'.$imag

How to display an image of the latest publication in wordpress

In Wordpress, I want to show the 2 latest posts along with the post thumbnail for just the first post. I have been playing around with the code below, but an image always ends up being shown for the first post as well as the second, when I only want

How to display an image in the upper right corner of an input box

I have an input box <span class="arrowDate"><input type="text" value="<?php echo $inputValue; ?>" id="<?php echo $id; ?>" class="datePickBox" /></span> What I want to achieve

How to display og: image given the URL of a page

I have a site for shopping recommendations, which allows users to post the urls for items they recommend. The form currently includes just a single input for a url to the main product page. If a user were to post a link like below: http://www.homedep

How to display an image of the database on the JSP page

//download_image.jsp file <%@page import="java.io.InputStream"%> <%@page import="java.io.OutputStream"%> <%@page import="java.sql.Blob"%> <%@page import="java.sql.ResultSet"%> <% // String

How to display separate images for the desktop and mobile browser using CSS?

http://tynesideelectrical.co.uk/ In this website displaying a phone number banner on header. i need to display a 'click to call' image instead of this number banner while browsing from mobile device. using with CSS. Any hope. ?Using CSS, you can embe

How to set the icon (image) in the dialog box while clicking on the button event

I created a Button,While i Click that Button a new Dialog Box is Displayed.In that dialog Box i have set icon and text.text is Displayed but icon(image) is not displayed in dialog Box. Here my Coding Button btnteam_westernbulldogs=new Button(this); b

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK