1
new CountDownTimer(30000, 1000) {
    public void onTick(long millisUntilFinished) {}

    public void onFinish() {
        setContentView(R.layout.another);
    }
}.start();

But when the user closes the app, it does not work.

How to do ?

Andrew Brooke
  • 12,073
  • 8
  • 39
  • 55
DazsMan
  • 11
  • 2
  • 1
    Is onFinish() invoked? – SuperFrog Nov 25 '15 at 14:28
  • 2
    I'd swap Fragments, instead. Because dealing with different Views (thrown in by different layouts) in the same Activity or Fragment can be tricky. – Phantômaxx Nov 25 '15 at 14:31
  • Try search AlarmManager. – tiny sunlight Nov 25 '15 at 14:33
  • 1
    swaping fragments should be the cleanest solution, but just calling setContentView will work, your problem is with that CountDownTimer heres the solution: http://stackoverflow.com/questions/8123231/android-count-down-timer-in-background – Nanoc Nov 25 '15 at 14:53

0 Answers0