Created
April 6, 2017 14:33
-
-
Save ShanakaWickramaarachchi/27de310dbf3dbb2d141125fc2724b46a to your computer and use it in GitHub Desktop.
This file contains 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
public class sms extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_sms); | |
} | |
public void composeMmsMessage(String message, Uri attachment) { | |
Intent intent = new Intent(Intent.ACTION_SEND); | |
intent.setData(Uri.parse("smsto:77000")); // This ensures only SMS apps respond | |
intent.putExtra("sms_body","Reg supa"); | |
// intent.putExtra(Intent.EXTRA_STREAM, attachment); | |
if (intent.resolveActivity(getPackageManager()) != null) { | |
startActivity(intent); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment