I tried it using Messages rather than a separate thread, and it seems
to work.  Essentially the same code, only the "run" routine in the
Runnable becomes a handleMessage routine in a subclass of Handler, and
you substitute the "send" methods in place of the "post" ones.  Seems
wiser to me, since it keeps all the GUI actions in the main thread.

On Oct 5, 1:56 pm, DanH <[email protected]> wrote:
> One problem we're seeing with the scheme is that the count that's
> being incremented "jumps" on press and release for some reason.  [Late
> breaking news:  That was a finger malfunction.]
>
> Also, I wonder if the separate thread is necessary -- couldn't one
> just send a Message to one's own thread with sendMessageAtTime or
> sendMessageDelayed?
>
> On Oct 5, 1:01 pm, Kumar Bibek <[email protected]> wrote:
>
> > This is ok I guess. You can optimize it or may be change a few things
> > according to your needs.
>
> > -Kumar Bibekhttp://techdroid.kbeanie.com
>
> > On Tue, Oct 5, 2010 at 11:28 PM, DanH <[email protected]> wrote:
> > > How does one create an auto-repeat Button on Android.  I found this:
>
> > >http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > > But it seems kind of heavyweight and clumsy.  Is there a better way?
> > > (One would think that this would be a built-in capability like it is
> > > on most other UIs.)
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<android-developers%[email protected]>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Kumar Bibek
> > Mobile  : +91-9663304186
> > Mail : [email protected]

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

Reply via email to