【问题标题】:Sharing intent whatsapp分享意图whatsapp
【发布时间】:2018-09-04 04:16:23
【问题描述】:
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Mass Venture");
shareIntent.putExtra(Intent.EXTRA_TEXT, "Download the Mass Venture Mobile Application to grab products with more offers. Use REFERENCE CODE:" + user_name);
shareIntent.setType("*/*");
startActivity(Intent.createChooser(shareIntent, "Refer & Earn"));

选择显示的whatsapp时,分享失败。我该如何解决这个问题?

【问题讨论】:

标签: android android-intent whatsapp


【解决方案1】:

试试这个:

String shareText = "Enter the dummy text to share";
        Intent intent_share = new Intent();
        intent_share.setAction(Intent.ACTION_SEND);
        intent_share.putExtra(Intent.EXTRA_TEXT, shareText);
        intent_share.setType("text/plain");
        Intent.createChooser(intent_share, "Share via");
        startActivity(intent_share);

【讨论】:

    【解决方案2】:
                        Intent share = new Intent(android.content.Intent.ACTION_SEND);
                        share.setType("text/plain");
                        share.addFlags(Intent.FILL_IN_CATEGORIES);
    
                        share.putExtra(Intent.EXTRA_CC, "Title Here");
    
                        String message = " Your message text"
    
    
                        share.putExtra(Intent.EXTRA_TEXT, message);
    
                        startActivity(Intent.createChooser(share, "Share With"));
    

    【讨论】:

      猜你喜欢
      • 2021-11-14
      • 2016-07-04
      • 1970-01-01
      • 2023-03-14
      • 2017-02-22
      • 2012-05-05
      • 1970-01-01
      • 1970-01-01
      • 2019-10-31
      相关资源
      最近更新 更多