I am trying to detect whether the tweet was successful or not. How can this be achieved on Android using the Fabric (Twitter Composer) api?
new TweetComposer.Builder(activity)
.text("#hastag").show();
What I want to do:
new TweetComposer.Builder(activity)
.text("#hastag").
.onSuccess(new Success(....))
.onFailure(new Failure(...)
.show();
I could listen to the onActivityResult method in the Activity but I was hoping there would be a cleaner and better way.
Instead of using .show();
, create an intent like this :
new Intent i = new TweetComposer.Builder(activity)
.text("#hastag").
.createIntent();
Now you can start the activity for result :
startActivityForResult(i, TWEETER_REQ_CODE);
where TWEETER_REQ_CODE
is just a numerical identifier.
next onActivityResult
wait for the TWEETER_REQ_CODE
to show up.
Hope it helped, N.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With