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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:06:24+00:00 2026-06-12T16:06:24+00:00

I want to have an Android dialog using Fragments that is fully customized: none

  • 0

I want to have an Android dialog using Fragments that is fully customized: none of the platform dialog theme pieces are included. For example, something like this:

Screen Shot

How do I do this?

  • 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-12T16:06:26+00:00Added an answer on June 12, 2026 at 4:06 pm

    The following Mono for Android C# code does the trick (but should be easy to port to Java). I tested on Android 2.2 (Galaxy S) and Android 4.1 (Nexus 7). The only thing you would need to change are the layout IDs used for the parent view and dialog view.

    [Activity (MainLauncher = true)]            
    public class TestCustomDialogActivity : FragmentActivity
    {
        public class MyDialogFragment : Android.Support.V4.App.DialogFragment
        {
            public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
            {
                // Android 3.x+ still wants to show title: disable
                Dialog.Window.RequestFeature(WindowFeatures.NoTitle);
    
                // CHANGE TO YOUR DIALOG LAYOUT or VIEW CREATION CODE
                return inflater.Inflate(Resource.Layout.MyLayout, container, true);
            }
    
            public override void OnResume()
            {
                // Auto size the dialog based on it's contents
                Dialog.Window.SetLayout(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
    
                // Make sure there is no background behind our view
                Dialog.Window.SetBackgroundDrawable(new ColorDrawable(Color.Transparent));
    
                // Disable standard dialog styling/frame/theme: our custom view should create full UI
                SetStyle(Android.Support.V4.App.DialogFragment.StyleNoFrame, Android.Resource.Style.Theme);
    
                base.OnResume();
            }
        }
    
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
    
            // CHANGE TO YOUR MAIN SCREEN
            SetContentView(Resource.Layout.MyDialog);
    
            var dialog = new MyDialogFragment();
            dialog.Show(SupportFragmentManager, "dialog");
        }        
    }
    

    I uploaded a full Mono for Android sample to https://github.com/t9mike/CustomDialogFragmentSample.

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

Sidebar

Related Questions

I have a dialog in an Android app that I don't want the user
I want to have a full documentation for android ndk. or a url that
Possible Duplicate: Android: ProgressDialog.show() crashes with getApplicationContext I want to have a progress dialog
I have an extended dialog class that I want to show for 3 seconds
I'm creating an android app. I have a Dialog, and I want to handle
I want install Android version 1.6 SDK. I already have Android development setup with
I have an Android application with a Spinner and want to fill it dynamically
I have an android app it displays web view.I want know the app idle
I have a Android project for SDK1.5 and now I want to convert it
I have an android application and while switching between two activities I want to

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.