Advertisement
Dhaval2404

Toast Problem

Oct 26th, 2015
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. private Toast mToastText;
  2. private void DelayStartRecord(RecordArg mRecordArg){
  3.     new  CountDownTimer(10*1000, 500) {
  4.  
  5.         public void onTick(long millisUntilFinished) {
  6.             String s="seconds remaining: " + millisUntilFinished / 1000;
  7.             if(mToastText==null){
  8.                 mToastText = Toast.makeText(SplashActivity.this, "", Toast.LENGTH_SHORT);
  9.             }
  10.             if(millisUntilFinished>=1000) {
  11.                 mToastText.setText(s);
  12.                 mToastText.show();
  13.             }else{
  14.                 mToastText.cancel();
  15.             }
  16.         }
  17.  
  18.         public void onFinish() {
  19.                       mMediaRecorder.start();
  20.         }
  21.  
  22.     }.start();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement