Reputation:
I declared these two variables in order to send a text message to declared number:
private String text="Hi";
private String emergencyNum="00962789113300";
Then in onCreat() method I wrote this:
SmsManager sender= SmsManager.getDefault();
sender.sendTextMessage(emergencyNum, null, text, null, null);
Unfortunately, the message was not sent and I got not responding status for my app. Could you help me to solve the problem.
Upvotes: 0
Views: 152
Reputation: 174
Please place the following permission into AndroidManifest.xml
file.
<uses-permission android:name="android.permission.SEND_SMS"/>
Upvotes: 1