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 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

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 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?}}); }}   

If I wanted to end it with a button? What should be the code?

  endbutton.setOnClickListener (New OnClickListener () {@Override Click Public Zero (see ARG0) {cdt.canel ();}    

You must cancel the timer at the count below.

  Public Ultimate Zero Cancel () Added API Level Cancel the countdown in 1.   

is a frequency variable mozilla cement

then

  Cdt = new countdown timer (10000,1000) {...   

then cdt.cancel () .

You also have < Code> Suppose that the count has ended below, you start the timer again. Do you want it?

Handler is a better option.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -