last day (14 days later) » 

19:03
0
Q: List View(In UI) contains all the components not in the list view

tusharI am trying to create a list view which would display records on entering a number. The number of records will be equal to the number entered in the given text field. It is working fine but the problem is the list contains all the components of the UI which are not required in the list. Below is...

What do you mean by components of the UI which are not required in the list?
the components @+id/numOfRows, @+id/set, @+id/date,@+id/time and @+id/retrive are part of @+id/data along with data. attaching screen shot for details.
How are you attaching the layout to the ListView in the code @tushar?
Using array adapter.
You only want one TextView to show for each list item?
19:03
@speedDeveloper activity_main is my base layout. Are you saying that passing the base layout to the array adapter is causing the issue?
yes
I'll post you how to do it
Thanks a lot. I appreciate your help.
I didn't test the code
But I'll now
If it's not working for you then wait a second please
did u send it to me?
I answered
19:14
Ok. thanks a lot. I'll check it.
It should work
I used this in onCreate:
I see that you have removed the list view out of the relative layout.
no
only the textview
and also the base layout to linear layout.
yes
I wanted to remove unnecessary layouts
Because layouts are ressource intensive
19:19
ok.. so if I use the layout structure provided by you, will the UI still look the same?
Yes. Try it out
I mean as I intent to before displaying the records.
Yes
but
the TextView building the ListView
has no padding and the textSize needs to be specified
Super.. I just move the text view to other layout and it worked. Thanks.
No problem :D
Look at the documentation
it can always give you some help
19:22
Yes I am following it.
Can you please mark my answer as right if there are no issues?
Thanks for the help.
yeah sure no prob.
i was on it

last day (14 days later) »