A table has 3 columns. and rows keep on increasing dynamically. I want to display the 1 row data in 1 textview.
So If there are 5 rows, I want to dynamically create 5 textviews and insert data into them.
What is the logic for dynamically creating textviews based on upon the row count?
in these cases you better use listview or recyclerView. you need to make an adapter for them to populate each row's view and data of the view.
this way the data would be shown dynamically. you can see the instruction to use listview in below:
http://www.vogella.com/tutorials/AndroidListView/article.html
Related
I am new in android application I want to create a table which will populate data from SQlite and show in a table with rows, columns, and then I want to edit, modify data in each column based on rows. I also want to disappear row after finishing modifications with click on a button. My question is, which layout should I use, Table layout or Grid view/layout????
I would suggest using a Table Layout. Although it uses table row as its child, you can actually use any View subclass as the child. Also, for your purposes, there is a lot of examples online for using a TableLayout and populating it with data from SQLite. A nice thing about the tableLayout is that it manages each row nicely in terms of sizing.
i have this table with dynamical table-row adding.
What I would like to do is not load the whole table because it sometimes has more than 10.000 rows.
I want to make a dynamically load the table is that possible?
For such thing, you must use ListView instead of TableLayout. Because with ListView, you can implement onScrollListener, with which you can load more iteam as and when required.
list view does have on scroll listener that will listen if you change focus of list view and you use simple logic to find when list view end is reached and respond accordingly
I would like to display 2 listview items in the same line, like favourite contacts in the default phone app. I do not need a full working solution, but only a guideline what to do.
Illustration:
There is a list of favourite contacts and there are 2 contacts (illustrated only by pictures) in 1 line.
Thanks!
You can write your own adapter to handle this, or you can use a GridView.
To use the custom Adapter strategy:
Create a row layout that has space for two elements.
In xml, for whatever you now consider one 'row', make a horizontal LinearLayout that can hold two of them next to each other. That's your new definition of a row.
In your Adapter, fill each row with two elements from your data set instead of the usual 1.
Take care to handle the case where the data set only has one element left.
Your alternative is to use a GridView,
I have to display web Services Data Either in Tabular form or in Grid form.Where rows and columns of the grid view dynamically increase or decrease.
Every column must have an header.
All the things including header ,images ,no of rows and columns of Grid view can change either product wise or Number of No of item wise.
Means There are No. of product and a Product have No. of Item and its properties.All these thing i have to display either in Grid view or in table view.Where header, images of product or item,and No. of rows and columns can change Dynamically.
What would be the best way to implement this.Does the custom Adapter for displaying the a dynamic table would be helpful.
Please Guide me.New In Stack Over Flow.
I want to create Gridview similar to WPF datagrid i don't know how many of you know about WPF data grid i'll explain its like having header row and rows to bind and whenever i click on each column of header row, the column 'll be sorted. But in this android list view i didn't see any header like in WPF but sorting is there and it'll sorted irrespective of column i.e. when i click on first column at row position '0' all columns 'll be sorted including header row (means header row going downwards) so how can i slove my problem?
Thanks,
#nag.
So you just want a header row in your listview? Call listView.addHeaderView() passing it the view/layout you want in the header.