开发者

android database value retrieving

开发者 https://www.devze.com 2023-03-04 11:02 出处:网络
I have a database with three rows and columns.I have managed to insert the开发者_如何转开发 data into the table.Now i am trying to retrieve the values in a tabular format in my xml view.

I have a database with three rows and columns.I have managed to insert the开发者_如何转开发 data into the table.Now i am trying to retrieve the values in a tabular format in my xml view. How to go about this.

Any help is appreciated.

Thanks.


What you're asking for is a fair amount of work, but saying that, it's relatively straight forward.

The problem is, your request is so vague that people are reluctant to help.

One possible solution (although it might not fit what you need) would be:

1) Create a ListActivity 2) Create a custom SimpleCursorAdapter. 3) Create a custom xml view for each row. 4) override SimpleCursorAdapter's getView() to inflate said xml view 5) Override SimpleCursorAdapter's bindView() method to assign values from the cursor to the row.

The questions in my mind which stopped me from trying to code this for you are: 1) Might you want to change the number of columns dynamically? 2) Might you want more flexibility as to how the column widths are decided upon? etc..

A slightly more complex setup would use TableLayout and TableRow.

0

精彩评论

暂无评论...
验证码 换一张
取 消