I have service in which I want to take pictures of the user. I have a timer task
myTimer = new Timer();
myTimer.schedule(new TimerTask() {
@Override
public void run() {
TimerMethod();
}
}, 0, 3000);
And the timer method
private void TimerMethod() {
if (na != null)
zzz.runOnUiThread(Timer_Tick);
}
private Runnable Timer_Tick = new Runnable() {
public void run() {
takePhoto(getApplicationContext(), 1);
}
};
My problem is that if i runOnUiThread the app is running slower.
How can I run in other thread that will not influence the user experience?
Many thanks.