点击链接的TextView文本到Android内置的消息应用程序 [英] button click Textview text to android inbuilt messaging app
本文介绍了点击链接的TextView文本到Android内置的消息应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何设置我的EDITTEXT文本的Android内置的消息应用程序撰写活动。 在这里我有code,从一个活动跳到另一个,如何设置我的EditText文本内置的消息应用程序。
公共类msg1Screen延伸活动{
按钮simpleBtn;
@覆盖
保护无效的onCreate(包savedInstanceState){
// TODO自动生成方法存根
super.onCreate(savedInstanceState);
的setContentView(R.layout.msg1);
simpleBtn =(按钮)findViewById(R.id.button1);
simpleBtn.setOnClickListener(新OnClickListener(){
公共无效的onClick(视图v){
// TODO自动生成方法存根
意图mgActivity =新的意图(msg1Screen.this,msgScreen.class);
startActivity(mgActivity);
}
});
}
解决方案
发送一条消息:
意向意图=新的意图(Intent.ACTION_VIEW,Uri.parse(短信:));
intent.putExtra(sms_body,yourEditTextString);
startActivity(意向);
要添加电话号码:
意向意图=新的意图(Intent.ACTION_VIEW,Uri.parse(短信:+ phoneNumber的));
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);
}
});
}
解决方案
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));
这篇关于点击链接的TextView文本到Android内置的消息应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文