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显示时,共享失败。我如何解决此问题?
尝试以下:
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);
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"));