Thanks, Romain, I will try...
On 19 окт, 14:00, Romain Guy wrote:
> There's no performance issue: you do all the work on a background thread and
> then you add everything in the adapter on the UI thread. A simple loop to
> add() several hundreds elements should not freeze the UI.
>
> On Oct 19,
There's no performance issue: you do all the work on a background thread and
then you add everything in the adapter on the UI thread. A simple loop to
add() several hundreds elements should not freeze the UI.
On Oct 19, 2009 2:49 AM, "Alexey" wrote:
On 16 окт, 20:10, Romain Guy wrote: > > (it i
On 16 окт, 20:10, Romain Guy wrote:
> > (it is a quote from sources ListView.java) and only in this case.
> > Thus, if number of elements wasn't changed, everything is ok.
Thanks, Sergey.
> If you modify the adapter without changing the number of items it can
> also be bad. It's just that Li
> (it is a quote from sources ListView.java) and only in this case.
> Thus, if number of elements wasn't changed, everything is ok.
If you modify the adapter without changing the number of items it can
also be bad. It's just that ListView does not detect this case.
> On 15 окт, 16:47, Alexey w
Alexey,
ListView chashes in case of:
if (mItemCount != mAdapter.getCount()) {
throw new IllegalStateException("The content of the
adapter has changed but "
+ "ListView did not receive a notification.
Make sure the content of "
+ "you
Romain, one more question. Is this rule applicable for adding/removing
elements from adapter (in other words - changing number of elements in
ListView) or also when changing content of elements?
On 15 окт, 16:31, Alexey wrote:
> Romain, your answers are clear, but confusing. As I understood
> mo
Romain, your answers are clear, but confusing. As I understood
modifying adapter should be done in worker thread and only
notifyDataSetChanged in UI thread.
Now as I see the concept is different, but what if we need to add
several hundred items into adapter, won't UI thread be in freeze for
this t
>That's a possibility. You could also just use a CursorAdapter
I also had this error, and I used SimpleCursorAdapter, that's why i
think, it isn't solution of the problem.
ccfrazier2,
Try to frequently select items, while list is adding new elements,
error may be repeated(may be not). ( if yo
>That's a possibility. You could also just use a CursorAdapter
I had also this error, and I used SimpleCursorAdapter, that's why i
think, it isn't solution of the problem.
ccfrazier2,
Try to frequently select items, while list is adding new elements,
error may be repeated(may be not). ( if you
Same issue here!
Thanks for the information!
-Moto!
On Oct 11, 3:11 pm, ccfrazier2 wrote:
> Romain,
>
> Fantastic, thanks for the help! I've had customers contact me over the
> months about
> force closes that I can never get to the bottom of. This likely has
> fixed the lingering
> issues. Gre
Romain,
Fantastic, thanks for the help! I've had customers contact me over the
months about
force closes that I can never get to the bottom of. This likely has
fixed the lingering
issues. Great news! Thanks,
pawpaw17
On Oct 11, 2:08 pm, Romain Guy wrote:
> > In my background thread if I add <
> In my background thread if I add < 100 elements to the array,
> everything works great. If
> I add more than 300 though I get the crash. Is this capacity related.
No, this is related to the use of threads. Even adding 1 element could
cause the crash. You just cannot really predict the behavior.
ccfrazier2 wrote:
> Thanks so much for the replies. Maybe I've been doing this wrong all
> along, I have
> 6 activites that use this same methodology, but YES, I guess this is
> the array used by
> the adapter (code below shows that is is).
>
> In my background thread if I add < 100 elements to t
Thanks so much for the replies. Maybe I've been doing this wrong all
along, I have
6 activites that use this same methodology, but YES, I guess this is
the array used by
the adapter (code below shows that is is).
In my background thread if I add < 100 elements to the array,
everything works great
--> myArrayList.add(i, new CalStats(name, extra, calories));
if that's the array list used by your adapter then you are modifying
it outside of the UI thread.
On Sun, Oct 11, 2009 at 11:07 AM, ccfrazier2 wrote:
>
> Yeah, it's the main thread of my app, here's the stack:
>
> myApp [Android Appli
Yeah, it's the main thread of my app, here's the stack:
myApp [Android Application]
myApp [Android Application]
DalvikVM[localhost:8613]
Thread [<3> main] (Suspended (exception IllegalStateException))
Thread [<15> Binder Thread #3] (Running)
When you get the error, can you see from the traceback which thread
you are in?
--
RichardC
On Oct 11, 4:06 pm, ccfrazier2 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 backgrou
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 stepp
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 priv
19 matches
Mail list logo