Search in sources :

Example 1 with DeletedTweetEvent

use of com.birbit.android.jobqueue.examples.twitter.events.DeletedTweetEvent in project android-priority-jobqueue by yigit.

the class PostTweetJob method onCancel.

@Override
protected void onCancel(@CancelReason int cancelReason, @Nullable Throwable throwable) {
    //delete local tweet
    Tweet localTweet = TweetModel.getInstance().getTweetByLocalId(localId);
    if (localTweet != null) {
        TweetModel.getInstance().deleteTweetById(localId);
        EventBus.getDefault().post(new DeletedTweetEvent(localId));
    }
}
Also used : DeletedTweetEvent(com.birbit.android.jobqueue.examples.twitter.events.DeletedTweetEvent) Tweet(com.birbit.android.jobqueue.examples.twitter.entities.Tweet)

Aggregations

Tweet (com.birbit.android.jobqueue.examples.twitter.entities.Tweet)1 DeletedTweetEvent (com.birbit.android.jobqueue.examples.twitter.events.DeletedTweetEvent)1