Android:消息意图

Gal*_* S2 7 sms android android-intent android-implicit-intent

我是android的初学者.我需要知道有没有打开Create Message窗口的意图.我试过这个代码 -

Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
Run Code Online (Sandbox Code Playgroud)

但是,它提出,Gmail, Email & Message我只需要提出信息.在我的应用程序中,当我按下按钮时,我将整合它.有谁知道这个?引导我.

goo*_*odm 8

你可以在你的xml文件中添加

android:onClick = "onClick" 
Run Code Online (Sandbox Code Playgroud)

和活动:

//main buttons listener
public void onClick(View view)
{
    switch (view.getId())
    {
            case R.id.sms:
            Intent intentsms = new Intent( Intent.ACTION_VIEW, Uri.parse( "sms:" + "" ) );
            intentsms.putExtra( "sms_body", "Test text..." );
            startActivity( intentsms );
            break;
    }
} 
Run Code Online (Sandbox Code Playgroud)