Search in sources :

Example 1 with EvaluationQuestionRequest

use of cl.smartcities.isci.transportinspector.serverConnection.requests.pushRequests.EvaluationQuestionRequest in project androidApp by InspectorIncognito.

the class EvaluationQuestionDialog method sendResponse.

private void sendResponse(int answerID, String token) {
    EvaluationQuestionRequest request = new EvaluationQuestionRequest(new Request.RequestListener<Pair<Integer, String>>() {

        @Override
        public void onRequestError() {
        }

        @Override
        public void onRequestResult(@NonNull Pair<Integer, String> response) {
            if (response.first != 200) {
                Log.d("EvaluationQuestion", "Server couldnt validate the request data");
            } else {
                Toast.makeText(TranSappApplication.getAppContext(), response.second, Toast.LENGTH_SHORT).show();
            }
        }
    }, token, answerID);
    ServerController.sendRequest(request, null);
}
Also used : EvaluationQuestionRequest(cl.smartcities.isci.transportinspector.serverConnection.requests.pushRequests.EvaluationQuestionRequest) EvaluationQuestionRequest(cl.smartcities.isci.transportinspector.serverConnection.requests.pushRequests.EvaluationQuestionRequest) Request(cl.smartcities.isci.transportinspector.serverConnection.requests.Request) Pair(android.support.v4.util.Pair)

Aggregations

Pair (android.support.v4.util.Pair)1 Request (cl.smartcities.isci.transportinspector.serverConnection.requests.Request)1 EvaluationQuestionRequest (cl.smartcities.isci.transportinspector.serverConnection.requests.pushRequests.EvaluationQuestionRequest)1