I am using SweetAlert Dialog for android.
https://github.com/pedant/sweet-alert-dialog
In the success dialog, I want to remove to the OK Button since I am using timer option, however no option for doing so has been mentioned in their docs. Please explain how can I remove the OK button.
MainActivity.java
public class Main2Activity extends AppCompatActivity {
private Firebase mRootRef;
private Button mBtn1;
private Button mBtn2;
int counter;
int counter1;
long value;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
Firebase.setAndroidContext(this);
mBtn1 = (Button) findViewById(R.id.btn1);
mBtn2 = (Button) findViewById(R.id.btn2);
mBtn1.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
if (v.equals(mBtn1)) {
mRootRef = new Firebase("https://voting-cf0fa.firebaseio.com/House/Jupiter/Player 1");
final Firebase mRefChild = mRootRef.child("Votes");
mRefChild.runTransaction(new Transaction.Handler() {
#Override
public Transaction.Result doTransaction(final MutableData currentData) {
if (currentData.getValue() == null) {
currentData.setValue(1);
} else {
currentData.setValue((Long) currentData.getValue() + 1);
}
return Transaction.success(currentData);
}
public void onComplete(FirebaseError firebaseError, boolean committed, DataSnapshot currentData) {
}
});
MediaPlayer click1 =MediaPlayer.create(getApplicationContext(), R.raw.click);
click1.start();
mBtn1.setEnabled(false);
mBtn2.setEnabled(false);
Timer buttonTimer = new Timer();
buttonTimer.schedule(new TimerTask() {
#Override
public void run() {
runOnUiThread(new Runnable() {
#Override
public void run() {
mBtn1.setEnabled(true);
mBtn2.setEnabled(true);
}
});
}
}, 5000);
final SweetAlertDialog Voted = new SweetAlertDialog(Main2Activity.this, SweetAlertDialog.SUCCESS_TYPE);
Voted.setTitleText("Voted");
Voted.setContentText("You Have cast your Vote!");
Voted.show();
Voted.findViewById(R.id.confirm_button).setVisibility(View.GONE);
final Timer t = new Timer();
t.schedule(new TimerTask() {
#Override
public void run() {
Voted.dismiss();
t.cancel();
}
}, 5000);
}
}
});
mBtn2.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
mRootRef = new Firebase("https://voting-cf0fa.firebaseio.com/House/Jupiter/Player 2");
if (v.equals(mBtn2)) {
Firebase mRefChild = mRootRef.child("Votes");
mRefChild.runTransaction(new Transaction.Handler() {
#Override
public Transaction.Result doTransaction(final MutableData currentData) {
if (currentData.getValue() == null) {
currentData.setValue(1);
} else {
currentData.setValue((Long) currentData.getValue() + 1);
}
return Transaction.success(currentData);
}
public void onComplete(FirebaseError firebaseError, boolean committed, DataSnapshot currentData) {
}
});
MediaPlayer click2 =MediaPlayer.create(getApplicationContext(), R.raw.click);
click2.start();
mBtn2.setEnabled(false);
mBtn1.setEnabled(false);
Timer buttonTimer = new Timer();
buttonTimer.schedule(new TimerTask() {
#Override
public void run() {
runOnUiThread(new Runnable() {
#Override
public void run() {
mBtn2.setEnabled(true);
mBtn1.setEnabled(true);
}
});
}
}, 5000);
final SweetAlertDialog Voted = new SweetAlertDialog(Main2Activity.this, SweetAlertDialog.SUCCESS_TYPE);
Voted.setTitleText("Voted");
Voted.setContentText("You Have cast your Vote!");
Voted.show();
Voted.findViewById(R.id.confirm_button).setVisibility(View.GONE);
final Timer t = new Timer();
t.schedule(new TimerTask() {
#Override
public void run() {
Voted.dismiss();
t.cancel();
}
}, 5000);
}
}
});
}
#Override
public void onBackPressed() { }
}
I am assuming your code is look like
new SweetAlertDialog(this, SweetAlertDialog.SUCCESS_TYPE)
.setTitleText("Good job!")
.setContentText("You clicked the button!")
.show();
So the answer is
SweetAlertDialog dialog = new SweetAlertDialog(this, SweetAlertDialog.SUCCESS_TYPE)
.setTitleText("Good job!")
.setContentText("You clicked the button!")
.show();
dialog.findViewById(R.id.confirm_button).setVisibility(View.GONE);
This also works
SweetAlertDialog sweetdialog = new SweetAlertDialog(this, SweetAlertDialog.SUCCESS_TYPE)
.setTitleText("Good job!")
.setContentText("You clicked the button!")
.show();
sweetdialog.getButton(SweetAlertDialog.BUTTON_CONFIRM).setVisibility(View.GONE);
new SweetAlertDialog(this, SweetAlertDialog.SUCCESS_TYPE)
.setTitleText("Good job!")
.setContentText("You clicked the button!")
.show();
// dont forget to add this in build.gradle
implementation 'com.github.f0ris.sweetalert:library:1.6.2'
Related
When I click a resend button first time, the button will disable for 2 seconds.After 2 seconds the button will enable?
I am using this code
btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
btn.setEnabled(false);
btn.postDelayed(new Runnable() {
public void run() {
btn.setEnabled(true);
Log.d(TAG,"resend1");
}
},1000);
}
});
But this code is not working properly.
try this for this purpose you can use Handler(import android.os.Handler;)
btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
btn.setEnabled(false);
new Handler().postDelayed(new Runnable() {
#Override
public void run() {
// This method will be executed once the timer is over
btn.setEnabled(true);
Log.d(TAG,"resend1");
}
},2000);// set time as per your requirement
}
});
You can use a timer for this
btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
myButton.setEnabled(false);
Timer buttonTimer = new Timer();
buttonTimer.schedule(new TimerTask() {
#Override
public void run() {
runOnUiThread(new Runnable() {
#Override
public void run() {
myButton.setEnabled(true);
}
});
}
}, 5000);
}
});
Find the solution
In your button click
long mLastClickTime;
yourButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
disableButtonTwoSecs();
// Here your implementation
}
});
public static boolean disableButtonTwoSecs() {
if (SystemClock.elapsedRealtime() - mLastClickTime < 2000) {
return true;
}
mLastClickTime = SystemClock.elapsedRealtime();
return false;
}
I am creating a voting app. A Firebase database counts the number of clicks of a button and displays it. However on closing the app and restarting, the number of clicks start back from zero. How can I keep adding the number the votes to the child node even after the app is closed and restarted instead of starting the votes from zero?
mainactivity.java
public class Main2Activity extends AppCompatActivity {
private Firebase mRootRef;
private Button mBtn1;
private Button mBtn2;
int counter = 0;
int counter1 = 0;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
Firebase.setAndroidContext(this);
mBtn1 = (Button) findViewById(R.id.btn1);
mBtn2 = (Button) findViewById(R.id.btn2);
mBtn1.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
if (v.equals(mBtn1)) {
mRootRef = new Firebase("https://voting-cf0fa.firebaseio.com/House/Jupiter/Player 1");
Firebase mRefChild = mRootRef.child("Votes");
counter++;
mRefChild.setValue(counter);
MediaPlayer click1 =MediaPlayer.create(getApplicationContext(), R.raw.click);
click1.start();
mBtn1.setEnabled(false);
mBtn2.setEnabled(false);
Timer buttonTimer = new Timer();
buttonTimer.schedule(new TimerTask() {
#Override
public void run() {
runOnUiThread(new Runnable() {
#Override
public void run() {
mBtn1.setEnabled(true);
mBtn2.setEnabled(true);
}
});
}
}, 5000);
final AlertDialog.Builder Voted = new AlertDialog.Builder(Main2Activity.this);
Voted.setTitle("Voted");
Voted.setMessage("You have cast Your Vote!");
Voted.setCancelable(false);
final AlertDialog dlg = Voted.create();
dlg.show();
final Timer t = new Timer();
t.schedule(new TimerTask() {
#Override
public void run() {
dlg.dismiss();
t.cancel();
}
}, 5000);
}
}
});
mBtn2.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
mRootRef = new Firebase("https://voting-cf0fa.firebaseio.com/House/Jupiter/Player 2");
if (v.equals(mBtn2)) {
Firebase mRefChild = mRootRef.child("Votes");
counter1++;
mRefChild.setValue(counter1);
MediaPlayer click2 =MediaPlayer.create(getApplicationContext(), R.raw.click);
click2.start();
mBtn2.setEnabled(false);
mBtn1.setEnabled(false);
Timer buttonTimer = new Timer();
buttonTimer.schedule(new TimerTask() {
#Override
public void run() {
runOnUiThread(new Runnable() {
#Override
public void run() {
mBtn2.setEnabled(true);
mBtn1.setEnabled(true);
}
});
}
}, 5000);
final AlertDialog.Builder Voted = new AlertDialog.Builder(Main2Activity.this);
Voted.setTitle("Voted");
Voted.setMessage("You Have cast your Vote");
Voted.setCancelable(false);
final AlertDialog dlg = Voted.create();
dlg.show();
final Timer t = new Timer();
t.schedule(new TimerTask() {
#Override
public void run() {
dlg.dismiss();
t.cancel();
}
}, 5000);
}
}
});
}
#Override
public void onBackPressed() { }
}
From the Firebase documentation :
Use our transactions feature when working with complex data that could be corrupted by concurrent updates
public void incrementCounter() {
firebase.runTransaction(new Transaction.Handler() {
#Override
public Transaction.Result doTransaction(final MutableData currentData) {
if (currentData.getValue() == null) {
currentData.setValue(1);
} else {
currentData.setValue((Long) currentData.getValue() + 1);
}
return Transaction.success(currentData);
}
#Override
public void onComplete(FirebaseError firebaseError, boolean committed, DataSnapshot currentData) {
if (firebaseError != null) {
Log.d("Firebase counter increment failed.");
} else {
Log.d("Firebase counter increment succeeded.");
}
}
});
}
I am making a voting app. There are two buttons and the number of clicks are stored in a Firebase database. However on closing the app(kill app process), the database gets refreshed and the counter starts from zero again. Is it possible for the database to start counting from where it left even after the app is killed.
Source Code for MainActivity.java
public class Main2Activity extends AppCompatActivity {
private Firebase mRootRef;
private Button mBtn1;
private Button mBtn2;
int counter = 0;
int counter1 = 0;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
Firebase.setAndroidContext(this);
mBtn1 = (Button) findViewById(R.id.btn1);
mBtn2 = (Button) findViewById(R.id.btn2);
mBtn1.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
if (v.equals(mBtn1)) {
mRootRef = new Firebase("https://voting-cf0fa.firebaseio.com/House/Jupiter/Player 1");
Firebase mRefChild = mRootRef.child("Votes");
counter++;
mRefChild.setValue(counter);
MediaPlayer click1 =MediaPlayer.create(getApplicationContext(), R.raw.click);
click1.start();
mBtn1.setEnabled(false);
mBtn2.setEnabled(false);
Timer buttonTimer = new Timer();
buttonTimer.schedule(new TimerTask() {
#Override
public void run() {
runOnUiThread(new Runnable() {
#Override
public void run() {
mBtn1.setEnabled(true);
mBtn2.setEnabled(true);
}
});
}
}, 5000);
final AlertDialog.Builder Voted = new AlertDialog.Builder(Main2Activity.this);
Voted.setTitle("Voted");
Voted.setMessage("You have cast Your Vote!");
Voted.setCancelable(false);
final AlertDialog dlg = Voted.create();
dlg.show();
final Timer t = new Timer();
t.schedule(new TimerTask() {
#Override
public void run() {
dlg.dismiss();
t.cancel();
}
}, 5000);
}
}
});
mBtn2.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
mRootRef = new Firebase("https://voting-cf0fa.firebaseio.com/House/Jupiter/Player 2");
if (v.equals(mBtn2)) {
Firebase mRefChild = mRootRef.child("Votes");
counter1++;
mRefChild.setValue(counter1);
MediaPlayer click2 =MediaPlayer.create(getApplicationContext(), R.raw.click);
click2.start();
mBtn2.setEnabled(false);
mBtn1.setEnabled(false);
Timer buttonTimer = new Timer();
buttonTimer.schedule(new TimerTask() {
#Override
public void run() {
runOnUiThread(new Runnable() {
#Override
public void run() {
mBtn2.setEnabled(true);
mBtn1.setEnabled(true);
}
});
}
}, 5000);
final AlertDialog.Builder Voted = new AlertDialog.Builder(Main2Activity.this);
Voted.setTitle("Voted");
Voted.setMessage("You Have cast your Vote");
Voted.setCancelable(false);
final AlertDialog dlg = Voted.create();
dlg.show();
final Timer t = new Timer();
t.schedule(new TimerTask() {
#Override
public void run() {
dlg.dismiss();
t.cancel();
}
}, 5000);
}
}
});
}
#Override
public void onBackPressed() { }
}
Thanks
Counter and counter1 are the local variable and you are not persisting them. As you are storing the value of counter and counter1 to the database, you should simply retrieve the value and increment it by 1.
mRefChild.addListenerForSingleValueEvent(new ValueEventListener() {
#Override
public void onDataChange(DataSnapshot dataSnapshot) {
// you can retrieve your stored value from dataSnapshot
Object data = dataSnapshot.getValue()
}
#Override
public void onCancelled(DatabaseError databaseError) {
}
});
It sounds like you are using order version of Firebase. Please refer this link https://firebase.google.com/support/guides/firebase-android and upgrade your project.
Above link also provides details about reading the data. In your case addListenerForSingleValueEvent(..) will solve your problem.
https://www.firebase.com/docs/java-api/javadoc/com/firebase/client/DataSnapshot.html
from your code it sounds like you directly storing value for Votes and there is no table structure or anything. So dataSnapshot.getValue() should return your value. however, I advise you to debug the code and and put a breakpoint Object data = dataSnapshot.getValue() and analyze the information in the dataSnapshot instance. Its all there.
once you retrieve the value, assign it to the counter or counter1 variable. so everytime you will start app, you will have updated value of votes back to your variable. you are already doing counter++ on button click so that should work as it is.
StartTimer() function Should call after button click event completed, but it is get executed before onclick event. ro how to stop timer before onclick event and start after onclick event.
How do I fix this?
btn1=(Button)findViewById(R.id.button);
btn2=(Button)findViewById(R.id.button2);
btn3=(Button)findViewById(R.id.button3);
timer = new Timer();
btn1.setOnClickListener(new View.OnClickListener()
{
#Override
public void onClick(View v) {
timer.cancel();
Toast.makeText(getApplicationContext(), "Button1", Toast.LENGTH_SHORT).show();
}
});
StartTimer();
btn2.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
timer.cancel();
Toast.makeText(getApplicationContext(), "Button2", Toast.LENGTH_SHORT).show();
}
});
StartTimer();
btn3.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
timer.cancel();
Toast.makeText(getApplicationContext(), "Button3", Toast.LENGTH_SHORT).show();
}
});
}
public void StartTimer()
{
timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
#Override
public void run() {
Log.v("timer", "Timer running");
}
}, 0, 5000);
Toast.makeText(getApplicationContext(), "Timer", Toast.LENGTH_LONG).show();
}
protected void onResume() {
super.onResume();
StartTimer();
}
}
There is already built in Timer class in android. So you can do like that:
import java.util.Timer;
Timer timer = new Timer();
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
timer.schedule(new TimerTask() {
#Override
public void run() {
Log.v("timer", "Timer running");
Toast.makeText(getApplicationContext(), "TIMER HAS FINISHED", Toast.LENGTH_SHORT).show();
}
}, 0, 5000);
btn1.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
timer.cancel();
Toast.makeText(getApplicationContext(), "Button1", Toast.LENGTH_SHORT).show();
}
});
StartTimer();
btn2.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
timer.cancel();
Toast.makeText(getApplicationContext(), "Button2", Toast.LENGTH_SHORT).show();
}
});
btn3.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
timer.cancel();
Toast.makeText(getApplicationContext(), "Button3", Toast.LENGTH_SHORT).show();
}
});
So just start timer in onCreate, and stop it when button clicked.
In my app i have Countdown Timer and dialog box in same class. when someone press quit button dialog box opens and in it 2 buttons yes and no. I want when someone press quit button timer pause and if someone press no button its resume with remaining seconds. I know for this i have to finish this timer and create new timer with remaining seconds. But i am unable to get remaining seconds. If someone know how to do this please help me.
Code of countdown timer-
counterTimer = new CountDownTimer(15000, 1000) {
public void onFinish() {
if(currentGame.getRound()==20)
{
nextBtn1.setEnabled(false);
nextBtn2.setEnabled(false);
nextBtn3.setEnabled(false);
nextBtn4.setEnabled(false);
nextBtn5.setEnabled(false);
final Handler handle = new Handler();
Toast.makeText(QuestionActivity.this, "Time's Up", Toast.LENGTH_SHORT).show();
Runnable delay = new Runnable() {
public void run() {
System.exit(0);
}
};
handle.postDelayed(delay,3000);
}
else if(currentGame.getRound()==0)
{
currentGame.decrementScore();
final Handler handle = new Handler();
Runnable delay = new Runnable() {
public void run() {
processScreen();
}
};
handle.postDelayed(delay,3000);
}
else if(currentGame.getRound()<=19)
{
nextBtn1.setEnabled(false);
nextBtn2.setEnabled(false);
nextBtn3.setEnabled(false);
nextBtn4.setEnabled(false);
nextBtn5.setEnabled(false);
currentGame.decrementScore();
final Handler handle = new Handler();
Toast.makeText(QuestionActivity.this, "Time's Up", Toast.LENGTH_SHORT).show();
Runnable delay = new Runnable() {
public void run() {
processScreen();
}
};
handle.postDelayed(delay,3000);
}
}
public void onTick(long millisUntilFinished) {
TextView time = (TextView) findViewById(R.id.timers);
time.setText( ""+millisUntilFinished/1000);
}
};
counterTimer.start();
}
Code for Dialog Box-
if(arg0.getId()==R.id.quit)
{
Button yes, no;
final Dialog dialog = new Dialog(this, R.style.FullHeightDialog);
dialog.setContentView(R.layout.dialog1);
dialog.setCancelable(true);
counterTimer.cancel();
//to set the message
TextView message =(TextView) dialog.findViewById(R.id.tvmessagedialogtext);
message.setText("Are you sure you want to Exit?");
yes = (Button) dialog.findViewById(R.id.bmessageDialogYes);
yes.setOnClickListener(new OnClickListener() {
public void onClick(View v)
{
finish();
startActivity(new Intent(QuestionActivity.this, SplashActivity.class));
}
});
no = (Button) dialog.findViewById(R.id.bmessageDialogNo);
no.setOnClickListener(new OnClickListener() {
public void onClick(View v)
{
dialog.dismiss();
nextBtn1.setEnabled(true);
nextBtn2.setEnabled(true);
nextBtn3.setEnabled(true);
nextBtn4.setEnabled(true);
}
});
dialog.show();
}
Dialog Box Code-
private long remaingtime, starttime = 15000;
MyCounter timer;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.question);
nextBtn1 = (Button) findViewById(R.id.answer1);
nextBtn1.setEnabled(true);
nextBtn1.setOnClickListener(this);
nextBtn2 = (Button) findViewById(R.id.answer2);
nextBtn2.setEnabled(true);
nextBtn2.setOnClickListener(this);
nextBtn3 = (Button) findViewById(R.id.answer3);
nextBtn3.setEnabled(true);
nextBtn3.setOnClickListener(this);
nextBtn4 = (Button) findViewById(R.id.answer4);
nextBtn4.setEnabled(true);
nextBtn4.setOnClickListener(this);
nextBtn5 = (Button) findViewById(R.id.quit);
nextBtn5.setEnabled(true);
nextBtn5.setOnClickListener(this);
timer = new MyCounter(starttime, 1000);
timer.start();
}
if(arg0.getId() == R.id.quit)
{
timer.cancel();
final Dialog dialog = new Dialog(this, R.style.FullHeightDialog);
dialog.setContentView(R.layout.dialog1);
dialog.setCancelable(true);
//to set the message
TextView message =(TextView) dialog.findViewById(R.id.tvmessagedialogtext);
message.setText("Are you sure you want to Exit?");
yes = (Button) dialog.findViewById(R.id.bmessageDialogYes);
yes.setOnClickListener(new OnClickListener() {
public void onClick(View v)
{
startActivity(new Intent(QuestionActivity.this, SplashActivity.class));
finish();
}
});
no = (Button) dialog.findViewById(R.id.bmessageDialogNo);
no.setOnClickListener(new OnClickListener() {
public void onClick(View v)
{
dialog.dismiss();
timer = new MyCounter(remaingtime, 1000);
timer.start();
nextBtn1.setEnabled(true);
nextBtn2.setEnabled(true);
nextBtn3.setEnabled(true);
nextBtn4.setEnabled(true);
}
});
dialog.show();
}
Count Down Timer Code-
public class MyCounter extends CountDownTimer
{
public MyCounter(long millisInFuture, long countDownInterval)
{
super(millisInFuture, countDownInterval);
}
#Override
public void onTick(long millisUntilFinished)
{
remaingtime = millisUntilFinished;
time = (TextView) findViewById(R.id.timers);
time.setText(""+millisUntilFinished/1000);
}
#Override
public void onFinish()
{
if(currentGame.getRound()==20)
{
nextBtn1.setEnabled(false);
nextBtn2.setEnabled(false);
nextBtn3.setEnabled(false);
nextBtn4.setEnabled(false);
nextBtn5.setEnabled(false);
final Handler handle = new Handler();
Toast.makeText(QuestionActivity.this, "Time's Up", Toast.LENGTH_SHORT).show();
Runnable delay = new Runnable() {
public void run() {
System.exit(0);
}
};
handle.postDelayed(delay,3000);
}
else if(currentGame.getRound()==0)
{
currentGame.decrementScore();
final Handler handle = new Handler();
Runnable delay = new Runnable() {
public void run() {
processScreen();
}
};
handle.postDelayed(delay,3000);
}
else if(currentGame.getRound()<=19)
{
nextBtn1.setEnabled(false);
nextBtn2.setEnabled(false);
nextBtn3.setEnabled(false);
nextBtn4.setEnabled(false);
nextBtn5.setEnabled(false);
currentGame.decrementScore();
final Handler handle = new Handler();
Toast.makeText(QuestionActivity.this, "Time's Up", Toast.LENGTH_SHORT).show();
Runnable delay = new Runnable() {
public void run()
{
processScreen();
}
};
handle.postDelayed(delay,3000);
}
}
}
Just count the seconds yourself on each tick and use them later to create a new timer.
try like that
private final long interval = 1000;
long millisLeft = 90000;
public class MalibuCountDownTimer extends CountDownTimer {
public MalibuCountDownTimer(long startTime, long interval) {
super(startTime, interval);
}
#Override
public void onFinish() {
Toast.makeText(context, "Time's up!", Toast.LENGTH_LONG).show();
}
#Override
public void onTick(long millisUntilFinished) {
millisLeft = millisUntilFinished;
System.out.println("The milies left is" + millisLeft);
}
}
#Override
public void onResume() {
super.onResume();
countDownTimer = new MalibuCountDownTimer(millisLeft, interval);
countDownTimer.start();
}
public void onPause() {
super.onPause();
countDownTimer.cancel();
}