Code example for Spinner

Methods: getSelectedItem

0
         
        return new Result(true, getSelectedSpinnerText(foundView));
    } 
 
    private String getSelectedSpinnerText(final Spinner foundView) {
        Object selectedItem = foundView.getSelectedItem();
        return (null != selectedItem) ? selectedItem.toString() : "";
    } 
 
    private Result notFoundResult(final String idArgument) {
        return Result.failedResult(String.format("Could not find %s with id %s.", Spinner.class.getName(), idArgument));
    } 
 
    @Override 
    public String key() {
        return "get_selected_spinner_item_text"; 
    } 
 
} 
Experience pair programming with AI  Get Codota for Java