Last active
August 29, 2015 14:13
-
-
Save sizovs/fdbfcbb00fa7a24b1fa6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onFloatingActionTrigger() { | |
getRandomQuestion(); | |
} | |
private void getRandomQuestion() { | |
setRefreshing(true); | |
NetworkActionMaker.MKE.networkRequest(mActivity, RequestDefinition.MY_QUESTIONS_GET_RANDOM, new NetworkActionCallback<QuestionWrapper>() { | |
// this is a non-abstract TEMPLATE METHOD. Empty by default. | |
@Override | |
public void onNetworkActionError() { | |
} | |
// invoked only if no exceptions | |
@Override | |
public void onNetworkActionDone(ResponseWrapper<QuestionWrapper> result) { | |
setRefreshing(false); | |
mAdapter.addRandomQuestion(result.getData().getQuestion()); | |
mQuestionsList.setSelectionAfterHeaderView(); | |
} | |
}, QuestionWrapper.class); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment