Tweet Id from Broadcast

android

#1

Hello i am using Twitter app card to get tweet id of what i am sharing on twitter for that i get result in broadcast receiver…the code i am using is

TwitterSession session = TwitterCore.getInstance().getSessionManager()
.getActiveSession();
Card card = new Card.AppCardBuilder(getActivity())
.imageUri(uri)
.googlePlayId(“com.twitter.android”)
.build();
Intent intent = new ComposerActivity.Builder(getActivity())
.session(session)
.card(card)
.hashtags("#nature")
.createIntent();
startActivity(intent);

public class MyResultReceiver extends BroadcastReceiver {
@Override
public void onReceive(final Context context, final Intent intent) {
Bundle intentExtras = intent.getExtras();
if (TweetUploadService.UPLOAD_SUCCESS.equals(intent.getAction())) {
// success
final Long tweetId = intentExtras.getLong(TweetUploadService.EXTRA_TWEET_ID);
Log.e(“tweetId”, “” + tweetId);
} else { // failure
final Intent retryIntent =intentExtras.getParcelable(TweetUploadService.EXTRA_RETRY_INTENT);
Log.e(“retryIntent”, “” + retryIntent); }}}

my problem is whenever i tweet i get the tweet id and it take more than 8 to 15 seconds to get tweet id and i have to hit API to send tweet id on server so i just want to know is there any success or failure callback for this…i also try it with “startActivityResult” with app cards but it gives resultcode cancel in both case in tweet success and tweet cancel…and Appcard Builder not gives any method to show loader.

problem is that we need to show loader on screen because Tweet id getting some time to receive in broadcast receiver so if loader will show then it will help to understand that something is happen in background to user but without success or failure response, not possible to show loader on UI.


#2

Any help will be really appriciated