Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set data in a Gridview dyanamically

 
NeelNisha Singh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a gridview and added adapter to show view dyanamically

Here is my code

1.GroupIDUDesAct .java


2.group_idu_des.xml


3.row_deactive.xml


So right now I'm getting output as attached screenshot output_1.png

But I'want to show each generated layout i.e row_active/row_deactive as attachment gridview.png ,Please suggest what i need to do or provide any small demo code
(want to keep all elements of row.xml in gridview and show them in a way like first row will be having only one column which will contain only one image,again second row will be having 2 columns containg
2 textviews as per attached screen gridview.png).Please help

gridview.PNG
[Thumbnail for gridview.PNG]
 
NeelNisha Singh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rightnow what output screen i'm getting is Output_1.png is attached here
output_1.PNG
[Thumbnail for output_1.PNG]
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what part are you having trouble with? The layout or the gridview or what?

Your row_deactive.xml is not that great. When using GridView (and probably ListView as well) you should try to avoid nesting layouts. You have a RelativeLayout with a LinearLayout inside. You do not need, and should not use the LinearLayout at all. You should just use the RelativeLayout. For reference see: http://developer.android.com/guide/topics/ui/layout/relative.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic