Created
August 19, 2016 18:24
-
-
Save mplacona/e474eaeadea90f1413ce5b4c58212e8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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