Maybe Bug found for setAdapter to Views

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Maybe Bug found for setAdapter to Views

Postby sommeralex » Sun Mar 02, 2008 4:08 pm

iam not sure if it is a bug or if my "logic" is not well enough.

If you an adapter, first, add all Elements to the adapter. At the end, add the adapter to your view/layout.

things, which worked:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. adapter.addElement(e)
  3.  
  4. setAdapter(adapter)
  5.  
  6.  
  7.  
  8.  
  9.  
  10. adapter.addElement(e)
  11.  
  12. setAdapter(adapter)
  13.  
  14. adapter.addElement(e)
  15.  
  16. adapter.addElement(e)
Parsed in 0.029 seconds, using GeSHi 1.0.8.4


what not was working was:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. setAdapter(adapter)
  2.  
  3. adapter.addElement(e)
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


what does the bug do: you wont have a selection-highlight function if you set the adapter before at least one element was added to the adapter.

alex
sommeralex
Experienced Developer
Experienced Developer
 
Posts: 95
Joined: Sun Jan 20, 2008 3:12 am
Location: Vienna

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: Google [Bot] and 4 guests