Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After some research I was able to figure out that mixing TableLayout and LinearLayout within my ListActivity XML document I was able to add a header to the document. Below is my XML document if anyone is interested to see it. While synic's approach is probably the right approach after work with his solution for sometime I was unable to make it function the way I wanted it.</p> <p>AuditTab.java</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.audittab); getListView().setEmptyView(findViewById(R.id.empty)); } </code></pre> <p>audittab.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TableLayout android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent"&gt; &lt;TableRow android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center_horizontal"&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android:layout_weight="1"&gt; &lt;Button android:id="@+id/btnFromDate" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="" android:layout_weight="1" /&gt; &lt;Button android:id="@+id/btnToDate" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="" android:layout_toRightOf="@+id/btnFromDate" android:layout_weight="1" /&gt; &lt;Button android:id="@+id/btnQuery" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Query" android:layout_toRightOf="@+id/btnToDate" android:layout_weight="1" /&gt; &lt;/LinearLayout&gt; &lt;/TableRow&gt; &lt;TableRow android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center_horizontal"&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;ListView android:id="@android:id/list" android:layout_width="300dip" android:layout_height="330dip" android:scrollbars="none" /&gt; &lt;TextView android:id="@+id/empty" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="10dip" android:text="- Please select a date range and press query." /&gt; &lt;/LinearLayout&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; </code></pre> <p>AuditItem.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:orientation="horizontal" android:padding="10sp"&gt; &lt;TextView android:id="@+id/transactionDateLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Date: " /&gt; &lt;TextView android:id="@+id/transactionDate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/transactionDateLabel" /&gt; &lt;TextView android:id="@+id/transactionTypeLabel" android:layout_below="@id/transactionDate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Type: " /&gt; &lt;TextView android:id="@+id/transactionType" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip" android:layout_below="@id/transactionDate" android:layout_toRightOf="@id/transactionTypeLabel" /&gt; &lt;TextView android:id="@+id/transactionAmountLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip" android:text="Amount: " android:layout_below="@id/transactionDate" android:layout_toRightOf="@id/transactionType" /&gt; &lt;TextView android:id="@+id/transactionAmount" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/transactionDate" android:layout_toRightOf="@id/transactionAmountLabel" /&gt; &lt;TextView android:id="@+id/transactionCategoryLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Category: " android:layout_below="@id/transactionAmountLabel" /&gt; &lt;TextView android:id="@+id/transactionCategory" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/transactionAmountLabel" android:layout_toRightOf="@id/transactionCategoryLabel" /&gt; &lt;TextView android:id="@+id/transactionToAccountLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="To Account: " android:layout_below="@id/transactionCategoryLabel" /&gt; &lt;TextView android:id="@+id/transactionToAccount" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/transactionCategoryLabel" android:layout_toRightOf="@id/transactionToAccountLabel" /&gt; &lt;TextView android:id="@+id/transactionFromAccountLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="From Account: " android:layout_below="@id/transactionToAccountLabel" /&gt; &lt;TextView android:id="@+id/transactionFromAccount" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/transactionToAccountLabel" android:layout_toRightOf="@id/transactionFromAccountLabel" /&gt; &lt;TextView android:id="@+id/transactionNoteLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Note: " android:layout_below="@id/transactionFromAccountLabel" /&gt; &lt;TextView android:id="@+id/transactionNote" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/transactionFromAccountLabel" android:layout_toRightOf="@id/transactionNoteLabel" /&gt; &lt;Button android:id="@+id/editTransactionBtn" android:layout_width="wrap_content" android:layout_height="40sp" android:visibility="gone" android:text="Edit" android:layout_below="@id/transactionNoteLabel"/&gt; &lt;Button android:id="@+id/deleteTransactionBtn" android:layout_width="wrap_content" android:layout_height="40sp" android:text="Delete" android:layout_below="@+id/transactionNoteLabel" android:visibility="gone" android:layout_toRightOf="@+id/editTransactionBtn" android:ellipsize="end"/&gt; &lt;/RelativeLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload