[android-developers] TimerTask and Handler without inner class.

2013-03-25 Thread bob
Timer task does not need to be an inner class.

Afaik, no one can make a class that neds to be inner.

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] TimerTask and Handler without inner class.

2013-03-23 Thread TreKing
On Sat, Mar 23, 2013 at 8:03 AM, MarkG123  wrote:

> Got a bit of a problem. I am trying to use TimerTask and Handler to do my
> background work, all the examples I have seen use the TimerTask as an inner
> class. I need my class to be a regular class, as it's called from a couple
> of different classes. Is this possible? Can someone show me how? Thanks.


Have you tried anything so far? Like making this separate class and trying
to use it?

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] TimerTask and Handler without inner class.

2013-03-23 Thread MarkG123
Got a bit of a problem. I am trying to use TimerTask and Handler to do my 
background work, all the examples I have seen use the TimerTask as an inner 
class. I need my class to be a regular class, as it's called from a couple 
of different classes. Is this possible? Can someone show me how? Thanks.

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] TimerTask

2011-02-04 Thread Kostya Vasilyev
Take a look at AlarmManager, use it with a manifest-declared broadcast 
receiver.


-- Kostya

04.02.2011 10:05, A N K ! T пишет:
nO I dont want to add background Service...so i started it from 
Outgoing  Call Receiver.. but after certain number of times it goes 
stopeed


On Thu, Feb 3, 2011 at 6:18 PM, Kostya Vasilyev > wrote:


Is this in a background service?

03.02.2011 15:40, A N K ! T пишет:

i am Starting a TimerTask but after few runs it got stops...is
there a way to know task is running or i shud start it again

-- 


A N K ! T..


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



-- 
Kostya Vasilyev -- WiFi Manager + pretty widget --

http://kmansoft.wordpress.com

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




--

 A N K ! T..


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



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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

Re: [android-developers] TimerTask

2011-02-03 Thread A N K ! T
nO I dont want to add background Service...so i started it from Outgoing
 Call Receiver.. but after certain number of times it goes stopeed

On Thu, Feb 3, 2011 at 6:18 PM, Kostya Vasilyev  wrote:

> Is this in a background service?
>
> 03.02.2011 15:40, A N K ! T пишет:
>
>> i am Starting a TimerTask but after few runs it got stops...is there a way
>> to know task is running or i shud start it again
>>
>> --
>>
>> A N K ! T..
>>
>>
>> --
>> 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
>>
>
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget --
> http://kmansoft.wordpress.com
>
> --
> 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




-- 

 A N K ! T..

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

Re: [android-developers] TimerTask

2011-02-03 Thread Kostya Vasilyev

Is this in a background service?

03.02.2011 15:40, A N K ! T пишет:
i am Starting a TimerTask but after few runs it got stops...is there a 
way to know task is running or i shud start it again


--

A N K ! T..


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



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


[android-developers] TimerTask

2011-02-03 Thread A N K ! T
i am Starting a TimerTask but after few runs it got stops...is there a way
to know task is running or i shud start it again

-- 

 A N K ! T..

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

[android-developers] TimerTask Thread problems

2010-01-11 Thread jax
I am having TimerTask Thread problems.  Basically I am running a
TimerTask to update a clock timer I have created.  When the user gets
an answer correct a small animation will play and the screen will be
idle for about 5 seconds, then it will resume with the next question.

The problem is that when I flip the G1 screen, the clock will have
already started (Sometimes almost 3/4 through).  It seems to me that
the initial TimerTask thread did not finish and now there are two
different ones running at the same time.  I have cancelled the
TimerTask and the Timer in the onStop() method as seem below.

Any ideas?

In the onStart() methods I have this:


mClockTimerTask = new TimerTask() {

@Override
public void run() {
if(!clockPaused) {
if(mClock.getSweepArc() >= 360) 
{
clockPaused = true;

mHandler.post(skipFromThread);
mClock.setAngleArc(0);
} else {
mHandler.post(new 
Runnable() {
@Override
public void 
run() {

mClock.setAngleArc(mClock.getSweepArc()+mArcChangePerSecond);
}
});
}
}


}
};

mClockTimer = new Timer();
mClockTimer.schedule(mClockTimerTask, 0,500);




Here is my onStop() method:

@Override
protected void onStop() {
super.onStop();
if (Constants.DEBUG_LOG) {
Log.d(TAG, "onStop()");
}

//Stop the timer
mClockTimerTask.cancel();
mClockTimer.cancel();
mClockTimer = null;
}
-- 
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

[android-developers] TimerTask and Views

2009-05-21 Thread Mooncat

Is it a no-no to try to update a View from a TimerTask? My initial
experiments indicate it doesn't work. Is there a way to make it work?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---