whatsapp如何编辑系统分享方式?
How whatsapp edited the system share method?
我有一个简单的问题,Whatsapp 开发人员是如何做到的:
(我们看到了什么?从我的图库中分享的普通图片,我可以立即与 Whatsapp 中的 8 个联系人分享...)
以前没见过,
我可以在自己的应用程序中做同样的事情吗?如何?
这是 Direct Share 功能,它是 introduced with Marshmallow. You can find an example application in the Google Repository。
To enable Direct Share, apps need to implement a Service extending
ChooserTargetService. Override the method onGetChooserTargets() and
return a list of Direct Share options.
In your AndroidManifest.xml, add a meta-data tag in your Activity that
receives the Intent. Specify android:name as
android.service.chooser.chooser_target_service, and point the
android:value to the Service.
我有一个简单的问题,Whatsapp 开发人员是如何做到的:
以前没见过, 我可以在自己的应用程序中做同样的事情吗?如何?
这是 Direct Share 功能,它是 introduced with Marshmallow. You can find an example application in the Google Repository。
To enable Direct Share, apps need to implement a Service extending ChooserTargetService. Override the method onGetChooserTargets() and return a list of Direct Share options.
In your AndroidManifest.xml, add a meta-data tag in your Activity that receives the Intent. Specify android:name as android.service.chooser.chooser_target_service, and point the android:value to the Service.