Iconified ListView is not working

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Iconified ListView is not working

Postby mauri » Sat Dec 22, 2007 12:56 am

Hi

i'm trying to build a ListView with more than one TextView in each Row.

my code for diplaying one TextView in the ListItem is this:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.                 ArrayAdapter<String> stackAdapter =
  3.  
  4.                     new ArrayAdapter<String>(this, R.layout.stack_list_item, model.stack.getList());
  5.  
  6.                
  7.  
  8.                 ListView listView = (ListView) findViewById(R.id.stackList);
  9.  
  10.                 listView.setAdapter(stackAdapter);
  11.  
  12.  
  13.  
  14.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


this is working pretty fine, but only with one TextView, i need two of the one with the "orderNumber" and one with the text.

I took the code form the IconifiedList. I changed the sample, instead of an Icon i need a TextView.
so the Sample is working good.

But, when i use the code in my Appliaction the List will not be filled.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.             IStackListAdapter itla = new IStackListAdapter(this);
  3.  
  4.  
  5.  
  6.             // Add four items
  7.  
  8.             itla.addItem(new IStackItem(
  9.  
  10.                    "Surf Web", "1:"));
  11.  
  12.             itla.addItem(new IStackItem(
  13.  
  14.                    "Report Bug", "2:"));
  15.  
  16.             itla.addItem(new IStackItem(
  17.  
  18.                    "Speak Spanish", "3:"));
  19.  
  20.             itla.addItem(new IStackItem(
  21.  
  22.                    "Vidoop", "4:"));
  23.  
  24.             // Display it
  25.  
  26.            
  27.  
  28.             ListView listView = (ListView) findViewById(R.id.stackList);
  29.  
  30.             listView.setAdapter(itla);
  31.  
  32.  
  33.  
  34.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


Instead of a ListActivity i have a Activity. The ListView is emmbeded in a AbsoluteLayout.


Any Idea why is not working?
User avatar
mauri
Junior Developer
Junior Developer
 
Posts: 13
Joined: Tue Dec 04, 2007 7:14 pm

Top

Postby lordhong » Sat Dec 22, 2007 5:14 am

:shock: i think u need a ListActivity to show the "list"...
lordhong
Developer
Developer
 
Posts: 42
Joined: Thu Nov 22, 2007 5:25 am
Location: New York

Postby mauri » Sat Dec 22, 2007 7:02 pm

I dont thick i need a ListActivity....

the Example shown above is working without a ListActivity... It's just a ListView in a AbsoluteLayout.
User avatar
mauri
Junior Developer
Junior Developer
 
Posts: 13
Joined: Tue Dec 04, 2007 7:14 pm

Postby plusminus » Sun Dec 23, 2007 2:44 pm

Hello mauri,

hm... pretty strange that it won't work with just slight changes.

One stupid thing I could mention is that perhaps you somewhere have a android:height="fill_parent" in the layout where it should not be. It feels like I wasted (summed) hours on that copy-paste error :cry:

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

[SOLVED]

Postby mauri » Mon Dec 24, 2007 12:48 pm

Thanks for the hint!

the problem was i settet the BackgroundColor of the ListView to black....
User avatar
mauri
Junior Developer
Junior Developer
 
Posts: 13
Joined: Tue Dec 04, 2007 7:14 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 11 guests