I am having trouble using the input from a javafx Textfield to search for tweets using Twitter4j. If I hard code the keywords in such as
String keyWords = "Obama";
Then it works fine. However I need to be able to get input from the textField to perform this search. I keep getting an error saying: 406:Returned by the Search API when an invalid format is specified in the request.
This is my code, anyone able to help me here?
FilterQuery fq = new FilterQuery();
String keywords;
keywords = keyWordsTextField.getText();
fq.track(keywords);
twitterStream.addListener(statusListener);
twitterStream.filter(fq);