//AsyncTask Class// protected class Check extends AsyncTask<String, JSONObject, Boolean> { String cc=null; @Override protected Boolean doInBackground(String... params) { RestAPI api = new RestAPI(); boolean codeAuth = false; try { JSONObject jsonObj = api.CodeAuthentication(params[0]); JSONParser parser = new JSONParser(); codeAuth = parser.parseCodeAuth(jsonObj); cc=params[0]; } catch (Exception e) { Log.d("Check", e.getMessage()); } return codeAuth; } @Override protected void onPostExecute(Boolean result) {//***HERE if (result) { Toast.makeText(getApplicationContext(), "Success!!",Toast.LENGTH_HORT).show(); } else { Toast.makeText(getApplicationContext(), "Error!!",Toast.LENGTH_SHORT).show(); } } } //BUTTON// public void ok(View view){ }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)