examples/examples/example/src/main/java/com/instructure/example/MainActivity.java
/**
     * Helper for making an API call.
     */
Helper for making an API call.
Helper for making an API call .
public void makeAPICall() {
        loadNextURLButton.setEnabled(false);
        if ("".equals(nextURL)) {
            ConversationAPI.getFirstPageConversations(conversationCanvasCallback, ConversationAPI.ConversationScope.ALL);
        }
        else if (nextURL != null) {
            ConversationAPI.getNextPageConversations(conversationCanvasCallback, nextURL);
        }
        else {
            Toast.makeText(getContext(), getString(R.string.noMoreItems), Toast.LENGTH_LONG).show();
            loadNextURLButton.setEnabled(true);
        }
    }
public void makeAPICall ( ) { loadNextURLButton . setEnabled ( false ) ; if ( "" . equals ( nextURL ) ) { ConversationAPI . getFirstPageConversations ( conversationCanvasCallback , ConversationAPI . ConversationScope . ALL ) ; } else if ( nextURL != null ) { ConversationAPI . getNextPageConversations ( conversationCanvasCallback , nextURL ) ; } else { Toast . makeText ( getContext ( ) , getString ( R . string . noMoreItems ) , Toast . LENGTH_LONG ) . show ( ) ; loadNextURLButton . setEnabled ( true ) ; } }
Helper for making an API call.
Helper for making an API call .
//Don't let them spam the button. //Check if the first api call has come back. //Check if we're at the end of the paginated list. //We are at the end of the list.