// we don't have to implement this method
private void searchTweets(final String keyword) {
        safelyUnsubscribe(subDelayedSearch, subLoadMoreTweets, subSearchTweets);
        lastKeyword = keyword;
        if (!networkApi.isConnectedToInternet(this)) {
            showSnackBar(msgNoInternetConnection);
            return;
        }
        if (!twitterApi.canSearchTweets(keyword)) {
            return;
        }
        subSearchTweets = twitterApi.searchTweets(keyword)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Subscriber<List<Status>>() {
                    @Override
                    public void onStart() {
                    }
                    @Override
                    public void onCompleted() {
                        // we don't have to implement this method
                    }
                    @Override
                    public void onError(final Throwable e) {
                        final String message = getErrorMessage((TwitterException) e);
                        showSnackBar(message);
                        showErrorMessageContainer(message, R.drawable.no_tweets);
                    }
                    @Override
                    public void onNext(final List<Status> tweets) {
                        handleSearchResults(tweets, keyword);
                    }
                });
    }
@Override
public void onCompleted() {
// we don't have to implement this method
}
@Override
}
subSearchTweets = twitterApi.searchTweets(keyword)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<List<Status>>() {
@Override
public void onStart() {
}
@Override
public void onCompleted() {
// we don't have to implement this method
}
@Override
public void onError(final Throwable e) {
final String message = getErrorMessage((TwitterException) e);
showSnackBar(message);
showErrorMessageContainer(message, R.drawable.no_tweets);
}
@Override
public void onNext(final List<Status> tweets) {
handleSearchResults(tweets, keyword);
private void searchTweets(final String keyword) {
safelyUnsubscribe(subDelayedSearch, subLoadMoreTweets, subSearchTweets);
lastKeyword = keyword;
if (!networkApi.isConnectedToInternet(this)) {
showSnackBar(msgNoInternetConnection);
return;
}
if (!twitterApi.canSearchTweets(keyword)) {
return;
}
subSearchTweets = twitterApi.searchTweets(keyword)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<List<Status>>() {
@Override
public void onStart() {
}
@Override
public void onCompleted() {
// we don't have to implement this method
}
@Override
public void onError(final Throwable e) {
final String message = getErrorMessage((TwitterException) e);
showSnackBar(message);
showErrorMessageContainer(message, R.drawable.no_tweets);
}
@Override
public void onNext(final List<Status> tweets) {
handleSearchResults(tweets, keyword);
}
});
}