Android: Using Timer to send SMS at regular intervals, but SMSes does'nt stop? -
I want to periodically send an SMS to the regular interval, using as is kept. The problem is that if the back button is pressed or is still being sent or I have tried clicking it on the button and ending the activity (this is Finnish ()), but it's no use. If I could just know how to turn the timer off by pressing a custom If I wanted to end it with a button? What should be the code? You must cancel the timer at the count below. is a frequency variable then then You also have < Code> Suppose that the count has ended below, you start the timer again. Do you want it? handler and others What can Google do to me, but I thought that the
Mozilla Timer function is very simple. I put the timer in a function and that function was returned to the
onFinish () function
CountDownTime r of
button , my purpose would be served.
timer.cancel () is to close the app instead of stopping
onClickListene R timer.
Creates a public void (bundled instenestate) {super.onCreate (SavedInstanceState); SetContentView (R.layout.main); MTextField = (TextView) FindBuyId (R.id.mTextField); Find the Endbutton = (VVBID) (RD); timerFunc (); } Public Zero TimerFunk () {New County Downtime (10000,1000) {Tick on Public Zero (Long Term Integrated End) {mTextField.setText ("Next Message" + "Mill Utility / 1000 /"); } Public void onFinish () {// mTextField.setText ("Done!"); // string finalms = "high at" + system syntetime millis (); // sendMsgFunc (final number, last message); Toast. Make text (getApplicationContext), "message sent", toast.lNGTH_LONG). Show (); timerFunc (); } }.Start(); End.setOnClickListener (New OnClickListener) Click on {@Override Public Zero (see ARG0) {// What should I do so that I can end this current session countdown? Stop sending messages at interval?}}); }}
endbutton.setOnClickListener (New OnClickListener () {@Override Click Public Zero (see ARG0) {cdt.canel ();}
Public Ultimate Zero Cancel () Added API Level Cancel the countdown in 1.
mozilla cement
Cdt = new countdown timer (10000,1000) {...
cdt.cancel () .
Handler is a better option.
Comments
Post a Comment