On Tue, Aug 30, 2011 at 11:10 PM, TreKing <[email protected]> wrote:
> On Tue, Aug 30, 2011 at 5:45 PM, Dalton Cézane <[email protected]>wrote: > >> Yes, do you want I put here all links I read before? >> > > No, but an indication of what you have already tried and what exactly > you're having trouble with helps. > > >> --> Most of them that I've seen (or all) have examples populating a >> gridview with some kind of list (String generally). >> > > Right - that's the basic concept. Once you have that, extending your list > to display an arbitrary view is fairly straightforward. > > >> But I didnt see a good sample (for me - I am new with android) reading a >> table and populating the gridview with these data. >> > > Which is it you need help with: the reading of a table or the populating > the gridview? > Also: what have you already tried? My problem is to populate the gridview. I already saw through the debugger that my code is reading the data correctly from the table, but when the activity is started, the gridview do not display nothing. My getView() method is: public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub TextView label = (TextView)convertView; if (convertView == null) { convertView = new TextView(this.context); label = (TextView) convertView; } label.setText((getDataFromTable().get(position)).toString()); //the geDataFromTable() returns a list with the data from the table (tested observing the debugger) return(convertView); } In my activity I have: ... ColetaDatabaseAdapter adapter = new ColetaDatabaseAdapter(this, R.layout.data_display); GridView g = (GridView) findViewById(R.id.grid); g.setAdapter(adapter); ... But I can not see the gridview on the display... Thanks. > > > > ------------------------------------------------------------------------------------------------- > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > transit tracking app for Android-powered devices > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- ======================================================= Dalton Cézane - Smarteju Tecnologia Especialista em Ciência da Computação (UFCG) Bacharel em Ciência da Computação (UFCG) Técnico em Informática (ETER) -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

