use of com.path.android.jobqueue.examples.twitter.events.PostingTweetEvent in project android-priority-jobqueue by path.
the class PostTweetJob method onAdded.
@Override
public void onAdded() {
//job has been secured to disk, add item to database
try {
Tweet tweet = new Tweet(localId, null, text, TwitterController.getInstance().getUserId(), null, new Date(System.currentTimeMillis()));
TweetModel.getInstance().insertOrReplace(tweet);
EventBus.getDefault().post(new PostingTweetEvent(tweet));
} catch (TwitterException exception) {
//if we cannot get user id, we won't add it locally for now.
}
}
Aggregations