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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:36:33+00:00 2026-05-31T18:36:33+00:00

The first image is from a Galaxy Note, the second is from a Droid

  • 0

The first image is from a Galaxy Note, the second is from a Droid 3. Both of them produced from the below code.

The dialog on the Droid 3 has a significant amount of extra, ugly space. This space is even uglier on more complex dialogs. Is there any way to prevent it?

public void onCreate(Bundle bundle)
    {
        super.onCreate(bundle);

        TextView tv = new TextView(this);
        tv.setText("Hello!");

        Dialog dialog = new Dialog(this);
        dialog.setContentView(tv);
        dialog.setTitle("Hi!");

        dialog.show();
    }

enter image description here

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-05-31T18:36:34+00:00Added an answer on May 31, 2026 at 6:36 pm

    These Droid UI customizations drive me crazy!

    If you’d like to control your dialogs to make them consistent across devices, you can strip them down to the basics with a constructor that supplies a style parameter. The following example gives a dialog that looks like this:

    sample dialog

    First, instantiate your dialog like this (or better yet, create a custom class that extends Dialog so you can reuse it):

    Dialog dialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar);
    dialog.setContentView(R.layout.custom_dialog_layout);
    

    Then, supply a custom_dialog_layout.xml (could look something like this):

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/layout_root"
        style="@style/VerticalLinearLayout"
        android:background="@android:color/transparent"
        android:gravity="center_vertical|center_horizontal" >
    
        <LinearLayout
            android:id="@+id/dialog_layout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:background="@drawable/dialog_background"
            android:orientation="vertical" >
    
            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="5dp"
                android:textColor="@android:color/white"
                android:text="Hi!" />
    
            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="5dp"
                android:textColor="@android:color/white"
                android:text="Hello!" />
    
        </LinearLayout>
    </LinearLayout>
    

    where dialog_background.xml looks something like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android" >
    
        <corners android:radius="10dp" />
    
        <stroke
            android:width="1dp"
            android:color="@android:color/black" />
    
        <gradient
            android:angle="0"
            android:startColor="@android:color/white"
            android:endColor="@android:color/white" />
    
    </shape>
    

    And if you really want to get fancy, you could try applying a drop shadow to the dialog_layout in code using something like this SO answer: https://stackoverflow.com/a/3723654/475217

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

Sidebar

Related Questions

I have this code that extracts the first image from an article in joomla:
I'm trying to get the first image from each of my posts. This code
I have a function which first reads an image from disk, resizes it and
Does anybody know how to get thumbnail (still image) from 3gb video file? First
I'm writing a function that fishes out the src from the first image tag
I have two BufferedImages I loaded in from pngs. The first contains an image,
I'm want to display different image version: first article: big banner second: small banner
I want to export the first image link from given text with PHP. Let's
How to remove first link with image from this text with PHP? <a href=some
Please visit this link Click on first Image. Now is showing the Modal page

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.