【问题标题】:Is there any callback method in twitter using fabric in android after sharing the post?分享帖子后,twitter 中是否有使用 android 中的 fabric 的回调方法?
【发布时间】:2016-07-18 05:15:33
【问题描述】:

我已使用以下代码在 twitter 上发布推文,用于自定义登录按钮

File file = captureScreen();
TweetComposer.Builder builder = new TweetComposer.Builder(getActivity())
.text("just setting up my Fabric.")
.image(Uri.fromFile(file));
builder.show();

与图片分享帖子工作正常,是否有任何回调方法可以成功向用户显示警报。

提前致谢。

【问题讨论】:

    标签: android twitter-fabric


    【解决方案1】:

    使用下面的代码 ->

    Intent i = new TweetComposer.Builder(this)
                        .text(content)
                        .url(new URL(url))
                        .createIntent();
                startActivityForResult(i, Constants.REQUEST_CODE_TWITTER);
    
    @Override
        protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
            super.onActivityResult(requestCode, resultCode, data);
            if (requestCode == Constants.REQUEST_CODE_TWITTER) {
                if (resultCode == RESULT_OK) {
                    // do your stuff
                }
            }
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-17
      • 2014-08-15
      • 1970-01-01
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      • 2021-06-01
      相关资源
      最近更新 更多