Slow Scrolling

by Al » Thu, 12 Mar 2009 07:01:07 GMT


Sponsored Links
 Hi, sometimes when I try to scroll using a scrollview (wrapped around
a textview), there will be no response. I've noticed this in both my
apps and the only common thing between them is the textview in both
apps use Spanned (SpanableStringBuilder to be exact) text. This
happens even when there is no activity on the window and no anr pops
up either.

Any idea what would be the cause?
Thanks.
--~--~---------~--~----~------------~-------~--~----~



Slow Scrolling

by AlCapwn » Thu, 12 Mar 2009 07:03:56 GMT


 Whoops, forgot to add this. When the freeze happened, I generated a
bugreport and it says this:

"main" prio=5 tid=3 TIMED_WAIT
  | group="main" sCount=1 dsCount=0 s=0 obj=0x400103e8
  | sysTid=2339 nice=0 sched=0/0 handle=-1096221588
  at java.lang.Object.wait(Native Method)
  - waiting on <0x1b6408> (a android.os.MessageQueue)
  at java.lang.Object.wait(Object.java:195)
  at android.os.MessageQueue.next(MessageQueue.java:144)
  at android.os.Looper.loop(Looper.java:110)
  at android.app.ActivityThread.main(ActivityThread.java:3739)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:739)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
  at dalvik.system.NativeStart.main(Native Method)

Not too sure why it would be wait()ing :s


--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Slow Scrolling

by Romain Guy » Thu, 12 Mar 2009 07:16:43 GMT


 It's waiting for events in the main events queue. That's pretty normal
to see this.







-- 
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

--~--~---------~--~----~------------~-------~--~----~



Slow Scrolling

by AlCapwn » Fri, 13 Mar 2009 02:35:35 GMT


 Is there any way to get around the problem of it being non responsive?
The lack of feedback to the scroll attempt is very noticeable.





--~--~---------~--~----~------------~-------~--~----~



Slow Scrolling

by Mariano Kamp » Fri, 13 Mar 2009 06:35:54 GMT


 I vaguely remember a similar problem too. Do you also see the dreaded "You
used the BufferedReader default constructor" (something like that) message?
I had the feeling that it lead to a lot of garbage collections which would
in turn explain the unresponsiveness I suppose.
Btw. I got rid of the Spanneds and now do the actual work (in my case HTML
rendering, more exactly translating html entities to text) ahead of time.








--~--~---------~--~----~------------~-------~--~----~



Slow Scrolling

by AlCapwn » Sat, 14 Mar 2009 02:01:48 GMT


 n Mar 12, 10:35pm, Mariano Kamp <mariano.k...@gmail.com> wrote:

I see the message but I don't think that is the problem, I've let the
app run for 10+ mins and in that time, GC was only called about 6
times. Bear in mind, this was with an active connection to a server
and continuous update (the data was coming at a very fast rate) of the
textview with the data from the server. (The server connection runs it
in's own thread.)

--~--~---------~--~----~------------~-------~--~----~



Slow Scrolling

by Mariano Kamp » Sat, 14 Mar 2009 03:11:40 GMT


 hen I don't know -
But what sounds strange to me is that you get lots of input (new objects,
some of them possible get discarded very quickly during transformations?
growing the heap?) and still only have a garbage collection every 90
seconds?

On Fri, Mar 13, 2009 at 7:01 PM, AlCapwn <alcapw...@googlemail.com> wrote:


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. event handler for holding a list item

There is the onListItemClick() function for handling item clicks in a
list activity.

How do you handle events which should occur when a person presses and
holds down a list item for >2 secs or so?  There must be a way to
handle these events, since the Contacts application does so (holding
down something in a list will bring up a popup menu of choices).

Anyone have any idea?  Thanks.
--~--~---------~--~----~------------~-------~--~----~

2. periodic updates of ListView

Hey all,

I was just hoping to get some suggestions on the best way to implement
this...

I have a ListView containing a list of objects with TextViews.  I want
to periodically update these TextViews on a periodic basis in the
background (I make an http post request to a server to receive the
updated text, and then insert it into the text view).  I don't want
the periodic updating of these views to interfere with the user
experience.

There are several ways I could think about doing this... either
through using a Service which I call periodically, a Service which
periodically sends updates (though I dunno if a Service can update an
Activity's list view), or spinning off a separate Thread from the
original Activity.

Does anyone have any suggestions which option would be optimal, and
why?

Thanks,

James

--~--~---------~--~----~------------~-------~--~----~

3. file system monitoring?

4. New to Programing and Android

5. weird behavior in ContentResolver().insert()

6. missing android.jar

7. Python