i’m currently creating a custom dialog (alertdialog is not flexible enough for my needs). and i want it to look like a AlertDialog, with that well kown AlertDialog header (see image below).
also i got a listview within my custom dialog and i want it to look like a listview of the AlertDialog. how could i do that?
so far i found alertDialogTheme and alertDialogStyle in the attr. class, but i don’t know how to use it.
what it should look like using a custom dialog:

what it looks like (black background, wrong header): 
my layouts are pretty basic and look like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp" >
<ListView
android:id="@+id/list"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
the listview contains items that use this layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:baselineAligned="false"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@drawable/icon_noimage" />
<TextView
android:id="@+id/text"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:ellipsize="end"
android:singleLine="true"
android:textColor="#ffffff"
android:textSize="18dp" />
</LinearLayout>
any ideas?
—> workaround using alerdialog with custom view, but now i got the following problem with some gaps:

You can create a normal
AlertDialogusing the typicalAlertDialogtitle/header but then set the content of the dialog to use a custom view:This will result in a normal looking
AlertDialogwith the normal looking title, but the content will use whatever custom view you want.For the ListView you want to display as the content, you are simply going to need to recreate the View as you see fit and use it as the
customLayoutin my example.