1. AC Question's Avatar
    We are developing a unique android java app which sends pictures to friends to solve a puzzle (just like Instagram) while using the app when there is an interruption for e.g., a call, or when device goes to sleep , a new timer starts running along with the old timer simultaneously. Can you guys suggest on how to resolve this bug ?
    i.e.,
    Seconds Remaining : 178 seconds
    Seconds Remaining : 156 seconds
    Seconds Remaining : 177 seconds
    Seconds Remaining : 155 seconds
    Seconds Remaining : 176 seconds
    Seconds Remaining : 154 seconds
    Seconds Remaining : 175 seconds
    Seconds Remaining : 154 seconds

    This is how the timer output is

    Please find the relevant code below:
    [sourcecode]
    countDownTimer = new CountDownTimer(180000, 1000) {

    public void onTick(long millisUntilFinished) {
    // how.setText(millisUntilFinished / 1000 + "seconds remaining: " );
    if(countTime.equals("yes"))
    {
    how.setText(count+" ");
    //how.setText(millisUntilFinished / 1000 );
    }
    else
    {
    //how.setText(count+" Seconds");
    how.setText(millisUntilFinished / 1000 + " seconds remaining" );
    }
    how.setTextSize(30);
    count++;
    if(count==180)
    {
    T.cancel();
    T=null;


    handler.postDelayed(new Runnable() {
    @Override
    public void run() {
    MainActivity.this.finish();
    }
    }, 5000);

    }
    }

    public void onFinish() {
    how.setText("Time Is Up!");
    }
    }.start();
    [/sourcecode]
    07-21-2014 11:37 PM

Similar Threads

  1. Replies: 21
    Last Post: 06-10-2017, 07:44 AM
  2. "DEVICE OVERHEATING" Message and Apps Closing
    By intelkw in forum Samsung Galaxy Note 8.0
    Replies: 28
    Last Post: 02-06-2017, 04:33 PM
  3. Does screen mirroring work from phone to tablet?
    By krynn72 in forum Samsung Galaxy S5
    Replies: 4
    Last Post: 07-22-2014, 10:34 AM
  4. Hangouts app theme
    By Beedog1221 in forum Ask a Question
    Replies: 1
    Last Post: 07-21-2014, 10:49 PM
  5. solution to reinstall apps
    By AC Question in forum Ask a Question
    Replies: 1
    Last Post: 07-21-2014, 10:45 PM
LINK TO POST COPIED TO CLIPBOARD