My app was a couple of custom classes that have long running processes in
them, so I instantiate them in a thread and pass them back to the activity
in a message and then from the handler run the FillProductInfo method which
updates the UI with the data.

I thought I might have a few problems storing the objects and restoring
state, but in a couple of hours this morning, I was able to save and restore
the objects. I thought I was done the tricky part, but when I call the same
method that updates the UI the first time, after restoring the objects the
following line always fails, itemView is always null, and the code that
updates the UI is never executed. 

To test this I'm just opening and closing the keyboard, and this method
works fine the first time. Just not after I open or close the keyboard
(testing on a G1 obviously). 

Private void FillProductInfo()
{
        View itemView = getListView().getChildAt(2);
        // we have the view now update the UI. 
        If (itemView != null)
        {
         // the updates.
      }
} 

I've tried calling FillProductInfo from OnCreate, OnRestoreState, OnStart,
and itemView is always null. I also tried calling ForceLayout before the
line above and it didn't help. 

The activity is a ListActivity. 

Anyone know what I'm doing wrong?



Sincerely,
 
Brad Gies
 
 
-----------------------------------------------------------------
Brad Gies
27415 Greenfield Rd, # 2,
Southfield, MI, USA
48076
-----------------------------------------------------------------
 
Moderation in everything, including abstinence



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to