I have the following code in the MainActivity.java
TimerTask timerTask = new TimerTask()
{
@Override
public void run()
{
Toast.makeText(MainActivity.this, "Timer", Toast.LENGTH_SHORT).show();
}
};
Timer timer = new Timer();
and on the button to start it I have
timer.schedule(timerTask,10,4000);
and when you press it, my app reboots and the timer does not start.