开发者

android database value retrieving

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜