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 7067483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:12:26+00:00 2026-05-28T05:12:26+00:00

From the official documentation: A subclass of Dialog that can display one, two or

  • 0

From the official documentation:

A subclass of Dialog that can display one, two or three buttons. If
you only want to display a String in this dialog box, use the
setMessage() method. If you want to display a more complex view, look
up the FrameLayout called “custom” and add your view to it:

 FrameLayout fl = (FrameLayout) findViewById(android.R.id.custom);
 fl.addView(myView, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));

But the problem is that android.R.id.custom presents only in OS from 8 API Level.

How can I make custom AlertDialog if I work with less API Level?

  • 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-05-28T05:12:27+00:00Added an answer on May 28, 2026 at 5:12 am

    actually what you do is as follows:

    first, you create the custom_layout.xml under res/layout.
    then you’ll add the next code to your activity

    Dialog myDialog = new Dialog(this);
    myDialog .setOwnerActivity(MyParentActivity.this);
    myDialog .setContentView(R.layout.custom_layout);
    myDialog .setTitle("title");
    

    and you can show and dismiss it usingmyDialog.show(); and myDialog.dismiss();

    if you have buttons or other views inside your custom_layout.xml, you can find them by

    Button myButton = (Button) myDialog.findViewById(R.id.myButton);
    

    I hope this helps.

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

Sidebar

Related Questions

From the official documentation I can't understand what is default parameter. obj, created =
I understand from the official documentation on unowned relationships that the app must use
I can't understand this line from the official documentation of mail function in PHP:
From the official MEF documentation : A Composable Part should contain at least one
From the official documentation: The reuse identifier is associated with a UITableViewCell object that
I've downloaded the svntask for ant from tigris.org, so it is the official one.
As per the official documentation of lxml, if one wants to validate a xml
The official documentation for TemporaryFile reads: The mode parameter defaults to 'w+b' so that
UPDATE : thanks to posters below, it's clear that the official documentation is up-to-date.
From the official documentation : Using the External Storage Every Android-compatible device supports a

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.