I have an SQLite database with just two small tables (6 columns between the two). I need that data pulled into an ExpandableListView so that the user will see the parents from one table and the children linked from the other table. This should be fairly simple and quick for someone who possesses this knowledge.
## Deliverables
I have an SQLite database with just two small tables (6 columns between the two). I need that data pulled into an ExpandableListView so that the user will see the parents from one table and the children linked from the other table.
One table is a table of links with a title, url, unique id and a foreign key to a parent table. It links, via the foreign key, to a parent table which contains categories to those links in the form of cat_id and cat_name. These need to be read into an ExpandableListView widget in the form of parent, children, parent, children, etc. Here are the specifics:
**link**
integer _id (primary key, autoincrement)
string title
string url
integer cat_id (references category.cat_id)
**category**
integer cat_id (primary key, autoincrement)
string name
Example data
link table
1 - Google - <[login to view URL]> - 1
2 - Yahoo - <[login to view URL]> - 1
3 - Lycos - <[login to view URL]> - 1
4 - Facebook - <[login to view URL]> - 2
5 - MySpace - <[login to view URL]> - 2
6 - WordPress - <[login to view URL]> - 3
7 - Blogger - <[login to view URL]> - 3
8 - TypePad - <[login to view URL]> - 3
category table
1 - Search Engines
2 - Social Networks
3 - Blogging
I'd like to list the data in the following manner using ExpandableListView
> Search Engines
Google
Yahoo
Lycos
> Social Networks
Facebook
MySpace
> Blogging
WordPress
Blogger
TypePad
* * *This broadcast message was sent to all bidders on Sunday Sep 5, 2010 2:12:59 PM:
I wanted to clear up a few things for this project. ExpandableListView needs to be built in a certain manner. The requirements of the project are the same. I just didn't specify how the code should specifically be delivered. It should change anything that much. [login to view URL] - should extend ExpandableListActivity and implement OnItemClickListener of the single click and OnItemLongClickListener for long-pressing an item. [login to view URL] should be the in the setContentView method of the onCreate method. [login to view URL] - Contains the ExpandableListView XML tag along with the android:empty XML tag. [login to view URL] - Should be the layout for the items in the ExpandableListView. Perhaps one is needed for the parent and one is needed for the children. I don't know how this works. The main thing to note is that the UI needs to be written in XML files, not just one simple Java file.