Android Question Problem sending text to incoming caller

doncx

Active Member
Licensed User
Longtime User
The example app attached captures the phone number of an incoming call and attempts to send a text to it.

If the text sending command p.send() has a hardcoded phone number then it works. Furthermore, when this is the case, the incoming phone call number is properly received.

However, if the incoming phone number received in PhoneStateChanged is sent through to the text sending p.send() then it fails with an error. The reason it fails is that the number is not properly received by PhoneStateChanged when it is subsequently used to send a text. This is exhibited in the logs.

I've tried several ways to mask the fact that the number was received from the phone but have not been able to send that number through to the text sender.

My app will not be posted on Google Play. It is in private distribution. Is there a way to accomplish this?

Please look at the attached dmcexample app. If you comment/uncomment the respective p.send() lines you'll see the weird problem.

Thanks for any assistance. I've read many forum threads on this topic but have not found the answer.
 

Attachments

  • DMCExample.zip
    11.3 KB · Views: 67
Solution
Maybe it's a timing issue - try setting up a timer (not a wait) to do the "send" 15 seconds after the phonestatechanged event happened and see if the send works.

JohnC

Expert
Licensed User
Longtime User
Maybe it's a timing issue - try setting up a timer (not a wait) to do the "send" 15 seconds after the phonestatechanged event happened and see if the send works.
 
Upvote 0
Solution
Top