如何使用意图与其他应用程序共享.gif文件? [英] How to share .gif file with in other App using intent?
本文介绍了如何使用意图与其他应用程序共享.gif文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在以下任何Android应用中共享.gif文件:
How to share .gif file in any of below Android apps:
- Snapchat
- Google Talk
- 线
- Viber
- Skype
- Facebook Messenger
为每个应用程序使用意图调用.
Using intent call for each apps.
推荐答案
对于Whatsapp,您可以使用以下方法:
For Whatsapp you can use this:
public void onClickWhatsApp(View view) {
Intent waIntent = new Intent(Intent.ACTION_SEND);
waIntent.setType("image/gif");
waIntent.setPackage("com.whatsapp");
if (waIntent != null) {
waIntent.putExtra(Intent.EXTRA_STREAM, uriToImage);
startActivity(Intent.createChooser(waIntent, "Share with"));
} else {
Toast.makeText(this, "WhatsApp not Installed", Toast.LENGTH_SHORT)
.show();
}
}
对于其他应用,您可以选择我认为相同的方案.
For the other apps you can choose the same scheme I think.
这篇关于如何使用意图与其他应用程序共享.gif文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文