Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8439805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:06:15+00:00 2026-06-10T08:06:15+00:00

I have found a lot of tutorials on how to make a custom ProgressDialog

  • 0

I have found a lot of tutorials on how to make a custom ProgressDialog without text. What is the easiest way to create a custom ProgressDialog with a custom image and a message. Something like this…

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:06:17+00:00Added an answer on June 10, 2026 at 8:06 am

    Creating a Custom Dialog

    If you want a customized design for a dialog, you can create your own layout for the dialog window with layout and widget elements. After you’ve defined your layout, pass the root View object or layout resource ID to setContentView(View).

    For example, to create the dialog shown to the right:

    Create an XML layout saved as custom_dialog.xml:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  android:id="@+id/layout_root"
                  android:orientation="horizontal"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:padding="10dp"
                  >
        <ImageView android:id="@+id/image"
                   android:layout_width="wrap_content"
                   android:layout_height="fill_parent"
                   android:layout_marginRight="10dp"
                   />
        <TextView android:id="@+id/text"
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:textColor="#FFF"
                  />
    </LinearLayout>
    

    This XML defines an ImageView and a TextView inside a LinearLayout.
    Set the above layout as the dialog’s content view and define the content for the ImageView and TextView elements:

    Context mContext = getApplicationContext();
    Dialog dialog = new Dialog(mContext);
    
    dialog.setContentView(R.layout.custom_dialog);
    dialog.setTitle("Custom Dialog");
    
    TextView text = (TextView) dialog.findViewById(R.id.text);
    text.setText("Hello, this is a custom dialog!");
    ImageView image = (ImageView) dialog.findViewById(R.id.image);
    image.setImageResource(R.drawable.android);
    

    After you instantiate the Dialog, set your custom layout as the dialog’s content view with setContentView(int), passing it the layout resource ID. Now that the Dialog has a defined layout, you can capture View objects from the layout with findViewById(int) and modify their content.
    That’s it. You can now show the dialog as described in Showing A Dialog.
    A dialog made with the base Dialog class must have a title. If you don’t call setTitle(), then the space used for the title remains empty, but still visible. If you don’t want a title at all, then you should create your custom dialog using the AlertDialog class. However, because an AlertDialog is created easiest with the AlertDialog.Builder class, you do not have access to the setContentView(int) method used above. Instead, you must use setView(View). This method accepts a View object, so you need to inflate the layout’s root View object from XML.

    To inflate the XML layout, retrieve the LayoutInflater with getLayoutInflater() (or getSystemService()), and then call inflate(int, ViewGroup), where the first parameter is the layout resource ID and the second is the ID of the root View. At this point, you can use the inflated layout to find View objects in the layout and define the content for the ImageView and TextView elements. Then instantiate the AlertDialog.Builder and set the inflated layout for the dialog with setView(View).

    Here’s an example, creating a custom layout in an AlertDialog:

    AlertDialog.Builder builder;
    AlertDialog alertDialog;
    
    Context mContext = getApplicationContext();
    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View layout = inflater.inflate(R.layout.custom_dialog,
                                   (ViewGroup) findViewById(R.id.layout_root));
    
    TextView text = (TextView) layout.findViewById(R.id.text);
    text.setText("Hello, this is a custom dialog!");
    ImageView image = (ImageView) layout.findViewById(R.id.image);
    image.setImageResource(R.drawable.android);
    
    builder = new AlertDialog.Builder(mContext);
    builder.setView(layout);
    alertDialog = builder.create();
    

    Using an AlertDialog for your custom layout lets you take advantage of built-in AlertDialog features like managed buttons, selectable lists, a title, an icon and so on.

    For more information, refer to the reference documentation for the Dialog and AlertDialog.Builder classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched a lot and couldn't found the approach to create the small
i have found a lot of tutorials and books that implements the auto-complete search
I have found a lot of information on using UIImagePickerController to let the user
I have found a lot of topics about stress-testing web application. My goals are
I've scored the internet for sources and have found a lot of useful information,
I have searched and found a lot of different things but none that actually
I have googled a lot on this and i have found integrations of Linkedin
I have Googled a lot and found a lot of solutions, but none of
OK - I have looked and looked and found a lot of examples but
We have a large database with a lot of data in it. I found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.