• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic