Skip to content

Instantly share code, notes, and snippets.

@mplacona
Created August 19, 2016 18:24
Show Gist options
  • Save mplacona/e474eaeadea90f1413ce5b4c58212e8f to your computer and use it in GitHub Desktop.
Save mplacona/e474eaeadea90f1413ce5b4c58212e8f to your computer and use it in GitHub Desktop.
mSend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
post(mContext.getString("YOUR_NGROK_URL/sms"), new Callback(){
@Override
public void onFailure(Call call, IOException e) {
e.printStackTrace();
}
@Override
public void onResponse(Call call, Response response) throws IOException {
runOnUiThread(new Runnable() {
@Override
public void run() {
mTo.setText("");
mBody.setText("");
Toast.makeText(getApplicationContext(),"SMS Sent!",Toast.LENGTH_SHORT).show();
}
});
}
});
} catch (IOException e) {
e.printStackTrace();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment