When you get the error, can you see from the traceback which thread
you are in?

--
RichardC

On Oct 11, 4:06 pm, ccfrazier2 <georgefraz...@yahoo.com> wrote:
> Romain,
>
> thanks for confirming that this message is new in 1.6.
>
> Actually, I mean to write "I'm sure my adapter mods are IN the UI
> thread, not the background thread". Anything else that can cause this?
>
> If I step through the code in the debugger I don't get the exception,
> but I I run without stepping I do. Also, when I run the phone on
> the app, I can get it to "work" 3 or 4 times, and then eventually I'll
> get the force close.
>
> Can anything else cause this?
>
> Here's my code in the background thread:
>
>         public void run(){
>                 int i = 0;
>                 lsDb.openDataBase();
>                 rescursor = lsDb.Search();
>                 if (rescursor.getCount() > 0){
>                     id_index = rescursor.getColumnIndex("_id");
>                     name_index = rescursor.getColumnIndex("Name");
>                     calories_index = rescursor.getColumnIndex("Calories");
>                     extra_index = rescursor.getColumnIndex("sodium");
>                 }
>                 if (rescursor.moveToFirst()){
>                         do {
>                                 int id = rescursor.getInt(id_index);
>                                 String name = rescursor.getString(name_index);
>                                 int calories = 
> rescursor.getInt(calories_index);
>                                 double extra= 
> rescursor.getDouble(extra_index);
>                                                                 // add
> to array list
>                                 myArrayList.add(i, new CalStats(name, extra, 
> calories));
>                                 i++;
>                                 }
>                         while (rescursor.moveToNext());
>                 }
>                 rescursor.close();
>                 lsDb.close();
>                 hh.post(postdoSearchDatabase);
>         }
>
> The "post" at the end is to a handler. I **do** modify the adapter in
> the run method there.
>
> On Oct 11, 1:36 am, Romain Guy <romain...@google.com> wrote:
>
> > It's not a bug, it's a message that was added to notify app developers
> > of applications that are doing the wrong thing.
>
> > > I'm sure my adapter mods are not in the UI thread.
>
> > Which is exactly the problem.
>
> > --
> > Romain Guy
> > Android framework engineer
> > romain...@android.com
>
> > Note: please don't send private questions to me, as I don't have time
> > to provide private support.  All such questions should be posted on
> > public forums, where I and others can see and answer them
>
>
--~--~---------~--~----~------------~-------~--~----~
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