• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

How to set data in a Gridview dyanamically

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic