• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps New instance of Activity start after sendSMS call.

Droid_Coder

Newbie
Hi,

I have created an app that sends out an SMS text message to a recipient. This all seems to be working fine, but after the message is sent using the sendSMS method, my application starts up a new instance. If I press the Back button, this clears the new instance and my original instance of the app is underneath it.

The basic flow of the app is:

1.) Start app
2.) Enter recipient and a time interval (in minutes)
3.) Click start button to start CountDownTimer
4.) When timer finishes build a text message and send to recipient via sendSMS
5.) Restart CountDownClock

Code looks straightforward enough. Can't figure out why it's starting the app again after the sendSMS.

Any thoughts?

Cheers...
 
After some playing around, I discovered that my call to sendTextMessage had the PendingIntent arugument defined, but I wasn't processing it. I changed the argument to 'null' and that stopped the app from starting a new instance each time a message was sent.

Cheers...
 
Back
Top Bottom