Android Intent.ACTION_发送共享文本以前工作得很好,但现在失败了 我使用下面相同的代码将文字分享到Line、微信,。。。 它以前工作得很好,但现在它不向其他应用程序传输任何内容。尽管我在sendIntent(如下)中跟踪以查看所有内容都是一样的和正确的

Android Intent.ACTION_发送共享文本以前工作得很好,但现在失败了 我使用下面相同的代码将文字分享到Line、微信,。。。 它以前工作得很好,但现在它不向其他应用程序传输任何内容。尽管我在sendIntent(如下)中跟踪以查看所有内容都是一样的和正确的,android,action,share,send,Android,Action,Share,Send,Intent.ACTION_发送共享文本以前工作得很好,但现在失败了 我使用下面相同的代码将文字分享到Line、微信,。。。 它以前工作得很好,但现在它不向其他应用程序传输任何内容。尽管我在sendIntent(如下)中跟踪以查看所有内容都是一样的和正确的。有没有人有类似的经历? 提前感谢您的建议! 伟大的这真的很有效,尽管我现在不知道为什么。我会研究细节。你为我节省了很多时间。非常感谢。伟大的这真的很有效,尽管我现在不知道为什么。我会研究细节。你为我节省了很多时间。非常感谢。 Floa

Intent.ACTION_发送共享文本以前工作得很好,但现在失败了 我使用下面相同的代码将文字分享到Line、微信,。。。 它以前工作得很好,但现在它不向其他应用程序传输任何内容。尽管我在sendIntent(如下)中跟踪以查看所有内容都是一样的和正确的。有没有人有类似的经历? 提前感谢您的建议!
伟大的这真的很有效,尽管我现在不知道为什么。我会研究细节。你为我节省了很多时间。非常感谢。伟大的这真的很有效,尽管我现在不知道为什么。我会研究细节。你为我节省了很多时间。非常感谢。
    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            //Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)  .setAction("Action", null).show();
            Intent sendIntent = new Intent();
            sendIntent.setAction(Intent.ACTION_SEND);
            sendIntent.putExtra(Intent.EXTRA_TEXT, editText.getText()); //EditText..getText() is Editable, still can get string
            sendIntent.setType("text/plain");
            startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));
        }
    });
 FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
 fab.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
          Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
          sharingIntent.setType("text/plain");              
          sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject here");
          sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, voiceTextView.getText());
          startActivity(Intent.createChooser(sharingIntent, "Sharing Option"));

     }
});