Flickr,Tumblr,Instagram在Android中分享意图 [英] Flickr, Tumblr, Instagram share intent in Android

查看:93
本文介绍了Flickr,Tumblr,Instagram在Android中分享意图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过Flickr,Tumblr,Instagram共享图像.我要使用这3个已安装的应用程序执行此操作.我在Instagram找到了

I want to share image via Flickr, Tumblr, Instagram. I want to do this with these 3 installed apps. I found for Instagram:

Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_TEXT, "" + getShareText());
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "" + getShareText());
shareIntent.putExtra(Intent.EXTRA_STREAM,
                    Uri.parse("file://" + file.getAbsolutePath()));
shareIntent.setPackage("com.instagram.android");

我也可以有Tumblr和Flickr吗?是的,我可以通过集成库来处理Oauth进程.但是我想通过安装的特定应用程序共享.

Can I have Tumblr and Flickr also? Yes, I can do with Oauth process by integrating libs. But I want to share via particular installed app.

推荐答案

只需在

sendIntent.setPackage(PACKAGE_NAME);

  • Tumblr:com.tumblr
  • Flickr:com.yahoo.mobile.client.android.flickr
    • Tumblr : com.tumblr
    • Flickr : com.yahoo.mobile.client.android.flickr
    • 您可以在Google Play商店网址中找到软件包名称:

      You can find the package names in the Google Play Store URLs :

      https://play.google.com/store/apps/details?id=PACKAGE_NAME

      PS:最好先检查该应用程序是否已安装在设备上:

      PS : it is better to check if the app is installed on the device first :

        try
        {
          getPackageManager().getApplicationInfo(PACKAGE_NAME, 0);
        }
        catch (PackageManager.NameNotFoundException e)
        {
          // Twitter not installed
        }
      

      使用SEND_ACTION共享无需在应用中使用OAUTH,在目标应用中管理身份验证.

      Sharing using SEND_ACTION do not require OAUTH in your app, auth is managed in the targeted app.

      谢谢

      这篇关于Flickr,Tumblr,Instagram在Android中分享意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆