【问题标题】:To post a photo in Twitter in android in a button click ? [closed]要在 android 的 Twitter 中单击按钮发布照片? [关闭]
【发布时间】:2012-11-06 09:22:31
【问题描述】:

在我的应用程序中,我想通过单击按钮在 Twitter 中发布照片。
所以我使用了很多代码但不起作用。 所以我想一键在twitter上分享照片的代码

【问题讨论】:

    标签: android


    【解决方案1】:

    在提问之前。尝试谷歌或搜索类似的问题。

    请看这里:see here

    【讨论】:

      【解决方案2】:

      试试这个:

                      Intent targetedShare = new Intent(android.content.Intent.ACTION_SEND);
                      targetedShare.setType("image/jpeg"); // put here your mime type
                      targetedShare.putExtra(Intent.EXTRA_TEXT,     "My body of post/email");
                      targetedShare.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(imagePath)) );
      
                      Intent chooserIntent = Intent.createChooser(targetedShare, "Select app to share");
                      chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetedShare);
                      startActivity(chooserIntent);
      

      【讨论】:

        猜你喜欢
        • 2021-08-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-27
        相关资源
        最近更新 更多