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);
                    }
                });
    }
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() {
                       
                    }
                    @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() { } @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); } }); }