Wechat Moments not in the options of Intent.createChooser matching ACTION_SEND

946 views Asked by At

I am now planning to share some text and link to SNS app in the phone. And the code I use is below:

    Intent shareIntent = new Intent();
    shareIntent.setAction(Intent.ACTION_SEND);
    shareIntent.putExtra(Intent.EXTRA_TEXT, "the word i like to say");
    shareIntent.setType("text/plain");
    this.startActivity(Intent.createChooser(shareIntent, "share with below apps"));
    return shareIntent;

there are so many options but unfortunately there is no Wechat Moments in it. Of course I can use shareSDK to achieve that, but the latter one has no Facebook/LinkedIn/Google+ in it. And there are too many 3rd libs included which I don't like. What is more, to show share options in two seperate menus is quite wired.

So, is there a way that I can add the option "Wechat moments" into the previous implementation(just like the image below) ? That will be quite helpful.

send to moments added into the options

1

There are 1 answers

1
Youngmin Kim On BEST ANSWER

Wechat only accepts image. Below will works.

Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(File obj));
shareIntent.setType("image/jpeg");
this.startActivity(Intent.createChooser(shareIntent, "share with below apps"));
return shareIntent;