ListView + SimpleCursorAdapter doesn't display data - android

Ok i know that this question have been asked a lot of times here and i have tried all the solutions but none seem to work. I am following the learning android book and i am trying to display the data from the database in a form of ListView using SimpleCursorAdapter to plug it in. The screen which is supposed to show the data doesn't show anything except for the title.
package com.example.yamba;
import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
public class TimelineActivity extends Activity {
static final String[] FROM = { StatusData.C_USER,StatusData.C_TEXT, StatusData.C_CREATED_AT};
static final int[]TO = {R.id.text_user,R.id.text_text,R.id.text_createdAt};
ListView list;
Cursor cursor;
SimpleCursorAdapter adapter;
#SuppressWarnings("deprecation")
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.timeline);
list = (ListView) findViewById(R.id.list);
adapter = new SimpleCursorAdapter(this, R.layout.row, cursor, FROM, TO);
list.setAdapter(adapter);
cursor = ((YambaApp) getApplication()).statusData.query();
// while (cursor.moveToNext()) {
// String user = cursor.getString(cursor.getColumnIndex(StatusData.C_USER));
// String text = cursor.getString(cursor.getColumnIndex(StatusData.C_TEXT));
// list.append(String.format("\n%s: %s", user, text));
// }
}
}
***Timeline.xml***
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/my_blue"
android:orientation="vertical" >
<TextView
android:id="#+id/timeline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="#string/Timeline" />
<ListView
android:id="#+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
<!--
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/timelineView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</ScrollView>
-->
</LinearLayout>
***row.xml***
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="#+id/text_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Slashdot"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/text_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/text_createdAt"
android:text="A really long example tweet for just test purposes"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/text_createdAt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/text_user"
android:layout_alignBottom="#+id/text_user"
android:layout_alignParentRight="true"
android:text="10 minutes ago"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
I have pasted my code above. Can anyone tell me what is messing up the display? Really appreciate the help
Thanks!!

The cursor needs to be created before you create the SimpleCursorAdapter, otherwise what are you passing in to the constructor. Here's a rewrite:
super.onCreate(savedInstanceState);
setContentView(R.layout.timeline);
list = (ListView) findViewById(R.id.list);
cursor = ((YambaApp) getApplication()).statusData.query();
adapter = new SimpleCursorAdapter(this, R.layout.row, cursor, FROM, TO);
list.setAdapter(adapter);

Related

Android: ArrayAdapter showing only one item even though the ListView isn't placed in a ScrollView

I am new to programming in Android. I encountered a problem where I need to print three items in a list View, yet getting only a single item. In many answers, I saw that ListView should't be placed in a ScrollView, I have rechecked my code, and that isn't actually the problem.
package com.apress.gerber.reminder;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class RemindersActivity extends AppCompatActivity {
private ListView mListView;
private String records[] = {"first record", "second record", "third record"};
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reminders);
mListView = (ListView) findViewById(R.id.reminders_list_view);
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(
this,
R.layout.reminders_row,
R.id.row_text,
records);
mListView.setAdapter(arrayAdapter);
}
}
Xml files:-
Reminders_row.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="48dp">
<view
android:id="#+id/row_tab"
class="android.view.View"
android:layout_width="10dp"
android:layout_height="match_parent"
android:background="#android:color/holo_green_light"
/>
<TextView
android:id="#+id/row_text"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="#string/reminder"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/white"
android:textSize="18sp"
android:layout_gravity="center_vertical"
android:padding="10dp"
android:ellipsize="end"
android:maxLines="1"/>
</LinearLayout>
</LinearLayout>
activity_reminders.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.apress.gerber.reminder.RemindersActivity">
<ListView
android:id="#+id/reminders_list_view"
android:layout_width="373dp"
android:layout_height="50dp"
android:background="#color/dark_grey"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp"
tools:listitem="#layout/reminders_row"/>
</RelativeLayout>
What actually is the error occuring?
If you are not going to extend your class with ArrayAdapter and customize getView method but you want to use your customized layout than your TextView must have id android:id="#android:id/text1" Or you can use android.R.layout.simple_list_item_1 in your ArrayAdapter like:
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(
this,
android.R.layout.simple_list_item_1,
records);
mListView.setAdapter(arrayAdapter);
Also for your ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"

Why is Android Bluetooth keyboard dpad down not working with listview containing a header view?

I have a list view that needs to support being navigable via a bluetooth keyboard. The list view also has a header view that needs to be navigable via the keyboard. The problem is when I press the down arrow, the focus is directed to a view above the list, in this example #+id/header . I need to press down as many times as there are list items for the focus to move to the list instead of going back and forth between the header and the list view's header...It's rather strange.
I've made a sample app to try and narrow the problem down to no avail. It's also worth noting if #+id/header is not focusable (for example when I made it a text view), the keyboard works as expected which, unfortunately, is not an option for me because my header needs to support bluetooth navigation.
Any help would be amazing, thanks.
MainActivity.java
package com.example.listviewtest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.widget.SimpleAdapter;
import android.widget.TextView;
public class MainActivity extends Activity {
private static final String TAG = MainActivity.class.getSimpleName();
private SimpleAdapter adapter;
private List<HashMap<String, String>> data;
private MyListView list;
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
list = (ListView) findViewById(R.id.listview);
TextView empty = (TextView) findViewById(R.id.empty);
// create the grid item mapping
String[] from = new String[] {"rowid"};
int[] to = new int[] { R.id.item1};
// prepare the list of all records
data = new ArrayList<HashMap<String, String>>();
for(int i = 0; i < 10; i++){
HashMap<String, String> map = new HashMap<String, String>();
map.put("rowid", "" + i);
data.add(map);
}
// fill in the grid_item layout
adapter = new SimpleAdapter(this, data, R.layout.grid_item, from, to);
list.addHeaderView(getLayoutInflater().inflate(R.layout.grid_header, null));
list.setEmptyView(empty);
list.setItemsCanFocus(true);
list.setAdapter(adapter);
}
}
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="#+id/main"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<Button
android:id="#+id/header"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="Header"
android:textAppearance="#android:style/TextAppearance.DeviceDefault.DialogWindowTitle"
android:padding="20dp"
android:layout_marginBottom="20dp"
android:onClick="toggleList"
android:clickable="true"
/>
<!-- ListView (grid_items) -->
<ListView android:id="#+id/listview"
android:layout_height="fill_parent"
android:layout_width="fill_parent" />
<TextView
android:id="#+id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="I'm empty"
android:gravity="center"
android:visibility="gone"/>
</LinearLayout>
grid_item.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/item1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:padding="20dp" />
grid_header.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:focusable="false"
style="?android:attr/buttonBarButtonStyle">
<TextView android:id="#+id/item1"
android:text="button1"
android:layout_height="fill_parent"
android:layout_width="wrap_content"
android:layout_weight="1"
android:width="0dp"
android:height="30dip"
style="?android:attr/buttonBarButtonStyle" />
<TextView android:id="#+id/item2"
android:text="button2"
android:layout_height="fill_parent"
android:layout_width="wrap_content"
android:layout_weight="1"
android:width="0dp"
android:height="30dip"
style="?android:attr/buttonBarButtonStyle" />
</LinearLayout>

Trouble catching onClick event from listview

I'm asking my user for a postcode via an editText then i use a button to fetch and display store locations in a listView using a simpleCursorAdapter.
Now i want to be able to launch a new activity by selecting an item in the listView and passing along some string information.
I can't get the onClickListener to register my clicks.
Is it because i'm using an Activity instead of a ListActivity?
I'd rather have both the input (the EditText) and the results (ListView) both in the same activity.
activity_pcentry:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/enter_post" />
<EditText
android:id="#+id/etPostCode"
android:imeOptions="actionSearch"
android:inputType="textCapCharacters"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" >
<requestFocus />
</EditText>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/search_button"
android:onClick="DoPostSearch" />
<ListView
android:id="#+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
stockrow_group:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:orientation="vertical"
tools:context=".MainActivity" >
<TextView
android:id="#+id/branch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" >
</TextView>
<TextView
android:id="#+id/post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" >
</TextView>
<TextView
android:id="#+id/telephone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" >
</TextView>
</LinearLayout>
PostCodeEntryActivity.java:
import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.Toast;
public class PostCodeEntryActivity extends Activity{
private MyDatabase stockistsDB;
public EditText enteredCode;
private ListView listView;
#Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pcentry);
stockistsDB = new MyDatabase(this);
}
public void DoPostSearch(View v) {
enteredCode = (EditText)findViewById(R.id.etPostCode);
String postalCode = enteredCode.getText().toString();
Cursor results = stockistsDB.getStockistsFromPostCode(postalCode);
if (results != null && results.getCount() > 0) {
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
R.layout.stockrow_group,
results, new String[]{"fld_BranchName","fld_PostCode","fld_Tel"},
new int[]{R.id.branch,R.id.post,R.id.telephone},
0);
listView = (ListView)findViewById(R.id.list);
listView.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener()
{
#Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
Toast.makeText(PostCodeEntryActivity.this, "Clicked", Toast.LENGTH_SHORT).show();
}
});
listView.setAdapter(adapter);
} else {
Toast.makeText(PostCodeEntryActivity.this, "No results found, please check your postcode", Toast.LENGTH_SHORT).show();
}
}
}
Do you have any clickable elements on the rows themselves? Please post the XML from R.layout.stockrow_group.
If you have buttons on that layout for example you might need to add the following to those buttons:
android:focusable="false"
android:focusableInTouchMode="false"
This will make sure the click on the list item is not getting blocked by the clickable item on the row itself.
The actual solution:
Do not make the rows of the listview clickable. This will "eat" up the click event by registering an empty click handler. Remove the following line from the rows of the list view:
android:clickable="true"
Implement AdapterView.onItemClickListener in your activity`
Change
listView.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener()
To
listView.setOnItemClickListener(this)
Add unimplemented methods

Button below listView

I am new to Android, and the first project I am working on is putting players onto a team. I have a listview that grabs all of the players from a database. Each name is supposed to have a checkbox next to them and then there is a button at the bottom that is supposed to update the database. So far this is what I am getting.
http://dyp.im/W79JdmfIk
Here is my activity
package com.example.sqllitetest;
import android.app.AlertDialog;
import android.app.ListActivity;
import android.content.Context;
import android.content.DialogInterface;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.widget.ResourceCursorAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
public class Tester extends ListActivity {
MyAdapter mListAdapter;
PlayersDBAdapter mDbHelper;
private Button button;
private Context context = this;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mDbHelper = new PlayersDBAdapter(this);
mDbHelper.open();
Cursor myCur = mDbHelper.fetchAllPlayers();
startManagingCursor(myCur);
setContentView(R.layout.playertoteam);
// registerForContextMenu(getListView());
// ((Tester) context).setContentView(R.layout.playertoteam);
//getListView().addFooterView(button);
mListAdapter = new MyAdapter(Tester.this, myCur);
setListAdapter((ListAdapter) mListAdapter);
Button button = (Button) findViewById(R.id.alertBox);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
setResult(RESULT_OK);
finish();
}
});
}
private class MyAdapter extends ResourceCursorAdapter {
public MyAdapter(Context context, Cursor cur) {
super(context, R.layout.playertoteam, cur);
}
#Override
public View newView(Context context, Cursor cur, ViewGroup parent) {
LayoutInflater li = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
return li.inflate(R.layout.playertoteam, parent, false);
}
#Override
public void bindView(View view, Context context, Cursor cur) {
TextView tvListText = (TextView)view.findViewById(R.id.code);
CheckBox cbListCheck = (CheckBox)view.findViewById(R.id.checkBox1);
tvListText.setText(cur.getString(cur.getColumnIndex(mDbHelper.KEY_NAME)));
cbListCheck.setChecked((cur.getInt(cur.getColumnIndex(mDbHelper.KEY_ID))==1? false:true));
}
}
}
And here is my xml file
<?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="wrap_content"
android:orientation="vertical"
android:padding="6dip" >
<Button
android:id="#+id/alertBox"
android:layout_alignParentBottom="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/confirm" />
<RelativeLayout
android:id="#+id/relativeLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="top" >
<ListView
android:id="#android:id/list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#id/alertBox"
/>
<TextView
android:id="#+id/code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<CheckBox android:id="#+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
/>
</RelativeLayout>
</LinearLayout>
I would like to know how to remove the buttons from the rows and the check box that is underneath the main confirm button. Also I would like to know if this is the best way to do something like this, because, once again, I am new and I don't know how to search for the correct methods.
ResourceCursorAdapter creates views ,for every row of the ListView, that are inflated in newView() method. You are getting button in every row because of this reason.
Soln: Create a separate xml defining the row layout for the ListView and inflate this new layout in the newView() method. And have only the button and ListView in main layout i.e. playertoteam.xml
playertoteam.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dip" >
<Button
android:id="#+id/alertBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="#string/confirm" />
<ListView
android:id="#android:id/list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_above="#id/alertBox" />
</RelativeLayout>
row_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"/>
<CheckBox
android:id="#+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_alignParentRight="true"/>
</RelativeLayout>
You can find example for ListView here
you can use addFooterView method of listview.
View footerView =
((LayoutInflater)
ActivityContext.
getSystemService
(Context.LAYOUT_
INFLATER_SERVICE)).inflate
(R.layout.footer_
layout, null, false);
ListView.addFooterView
(footerView);

Trying to use a listview in .xml with a cursor but without a ListActivity

I'm stumped as to how to properly implement an adapter that can pull a column of data from my sqlite database and add it to a listview (based on the android-provided multiple checkbox). All of the existing examples use the following:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String[] myList = new String[] {"Hello","World","Foo","Bar"};
ListView lv = new ListView(this);
lv.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,myList));
setContentView(lv);
}
However, I don't want a string. Here's my code:
public class ListGroups extends Activity {
/** Called when the activity is first created. */
private ExpensesDbAdapter mDBHelper;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.view);
ListView lv = (ListView)findViewById(R.id.list1);
mDBHelper = new ExpensesDbAdapter(ListGroups.this);
mDBHelper.open();
Cursor c = mDBHelper.fetchAllGroups();
startManagingCursor(c);
String[] from = new String[] {ExpensesDbAdapter.KEY_GROUPNAME};
int[] to = new int[] {R.id.groupname};
ListAdapter ladapter = new SimpleCursorAdapter(ListGroups.this, R.layout.grouprow, c, from, to);
lv.setAdapter(ladapter);
lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
}
}
Here's the view.xml file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center">
<TextView android:id="#+id/header01"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Select Groups"/>
<ListView
android:id="#+id/list1"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/footerbutton01"
android:text="Get Expense Reports" />
</LinearLayout>
And, because the SimpleCursorAdapter asks for it, here's the grouprow.xml:
<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/groupname"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:paddingLeft="6dip"
android:paddingRight="6dip"/>
If I use a ListActivity and don't invoke the layout on Creation, I can get it to work, but I need the wrappers around that ListView, and I can't make the .addHeader and .addFooter methods work for me. Any help on creating the proper adapter would be appeciated.
Answered it with some help. Several things were wrong, mostly in the list.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center">
<TextView android:id="#+id/header01"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Select Groups"/>
<ListView
android:id="#android:id/android:list"
android:layout_width="match_parent"
android:layout_height="wrap_around"
android:layout_weight="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/footerbutton01"
android:text="Get Expense Reports" />
</LinearLayout>
This allows you to tie the ListView to that element in the xml. You don't have a name for it, but you can use getListView() in the onCreate method to access it.

Categories

Resources