Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/379.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 发送消息而非SMS的意图选择器_Java_Android - Fatal编程技术网

Java 发送消息而非SMS的意图选择器

Java 发送消息而非SMS的意图选择器,java,android,Java,Android,我正在尝试通过各种各样的应用程序发送消息,如WhatsApp、Facebook、Twitter等 现在我用这个: Intent messageIntent = new Intent(Intent.ACTION_VIEW,Uri.fromParts("smsto",showPhone.getText().toString(),null)); 我应该用什么来代替smsto 它只要求短信应用,我想要所有的短信应用,如Whatsapp、Facebook等。试试这个,它会帮你解决这个问题

我正在尝试通过各种各样的应用程序发送消息,如WhatsApp、Facebook、Twitter等

现在我用这个:

Intent messageIntent = 
new Intent(Intent.ACTION_VIEW,Uri.fromParts("smsto",showPhone.getText().toString(),null));
我应该用什么来代替smsto


它只要求短信应用,我想要所有的短信应用,如Whatsapp、Facebook等。

试试这个,它会帮你解决这个问题

            Intent sharingIntent = new Intent(Intent.ACTION_SEND);
            sharingIntent.setType("text/plain");
            sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(textToShare));
            startActivity(Intent.createChooser(sharingIntent,titleOfSharingWindow));    

我想把一个号码也传给短信,WhatsApp应用程序。上面的代码似乎不可能。我想通过号码发送短信。我试过你的代码bt。它不显示消息应用程序(android默认)它对我部分有效,所以我不接受你的答案,但给你+1票。如果你知道号码/联系人,怎么办?