问题
how to set my editText text into android inbuilt messaging app compose activity. here i am having code to jump from one activity to another, how to set my edittext text into inbuilt messaging app.
public class msg1Screen extends Activity {
Button simpleBtn;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.msg1);
simpleBtn=(Button)findViewById(R.id.button1);
simpleBtn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent mgActivity = new Intent(msg1Screen.this, msgScreen.class);
startActivity(mgActivity);
}
});
}
回答1:
Send a message:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:"));
intent.putExtra("sms_body", yourEditTextString);
startActivity(intent);
To add a phone number :
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:" + phoneNumber));
来源:https://stackoverflow.com/questions/27671131/button-click-textview-text-to-android-inbuilt-messaging-app