How to access ListView elements before screen repainting?

Put your problem here if it does not fit any of the other categories.

How to access ListView elements before screen repainting?

Postby Asgard » Wed Jan 16, 2008 1:08 pm

Hi all. I need to know how to access ListView element before screen repainting?

I have the following code:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  
  3.  
  4. private ListView list;
  5.  
  6.  
  7.  
  8. public void onCreate(Bundle icicle) {
  9.  
  10.               super.onCreate(icicle);      
  11.  
  12.                   setContentView(R.layout.test);                             
  13.  
  14.              
  15.  
  16.               list = (ListView) findViewById(R.id.list);
  17.  
  18. }
  19.  
  20.  
  21.  
  22. public void onStart() {
  23.  
  24.             super.onStart();
  25.  
  26.                 View view = list.getChildAt(0);        
  27.  
  28.                  if(view != null)
  29.  
  30.                 ((TextView)view).setTextColor(Color.SOME_SPECIAL_COLOR);
  31.  
  32.                            
  33.  
  34.         }
  35.  
  36.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


But list.getChildAt(index) returns null.
Catch the moment
Asgard
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Dec 15, 2007 8:49 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 15 guests