I have been working on a ListView
that allows me to display individual custom list objects, as well as group objects which contain the aforementioned individual list objects. At first I started by using an ExpandableListView
, but I didn't like the way that it looked. Instead, I decided to use a Dialog
with a custom layout in order to display the children of a group object within my ListView
, as shown below:
Here is the layout for my Dialog
:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/helmet_listview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="5dp"
android:cacheColorHint="@android:color/transparent"
android:choiceMode="multipleChoice"
android:layout_weight="1"
android:isScrollContainer="false">
</ListView>
<LinearLayout
android:id="@+id/btnHolderLL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/dismiss_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingRight="1dp"
android:paddingLeft="1dp"
android:textColor="#FFFFFF"
android:background="@drawable/button_selector"
android:text="Dismiss"
android:clickable="true" />
</LinearLayout>
</LinearLayout>
They layout is basically just a copy of the layout used for the main Activity
that contains the Listview
, but while said Activity
contains the action bar, the Dialog
does not. So my question is, how do I go about adding a simple action bar with a title, as shown in the main Activity
, to my Dialog
. As a side note, I also noticed that the ListView
in my Dialog
doesn't have any dividers. This is not as important as the action bar, but some insight into this would be appreciated as well.