我已将 Twitter Fabric SDK 包含在我的 Android 应用程序中,并且可以从中发布推文。我也想发布图像,但通过用于发布纯文本推文的 StatusesService
似乎不可能。
难道不能通过SDK来做到这一点吗?我必须为此做一个明确的 http post 吗?
最佳答案
根据Fabric SDK ,是的,您可以通过 TweetUI 在推文中嵌入媒体。
示例代码
使用 Fabric 初始化
Fabric.with(this, new TweetComposer());
推文代码
TweetComposer.Builder builder = new TweetComposer.Builder(this)
.text("just setting up my Fabric.")
.image(myImageUri);
builder.show();
File myImageFile = new File("/path/to/image");
Uri myImageUri = Uri.fromFile(myImageFile);
记住
In the event that the Twitter app is not installed, TweetComposer will create an intent to interact with the Twitter.com in a browser. The browser ignores a specified image.
关于android - 使用 Twitter Fabric SDK 发布媒体推文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30000105/