This is my Doinbackground,and for some reason i don't find anything in String s of postexecute,am i doing anything wrong ??,btw calling this asynctask by new mytask().execute(Url,dum) from another class
@Override
protected String doInBackground(String... strings) {
String email = strings[0];
Request.Builder builder = new Request.Builder();
// String json1="{'dashboardData':'SERVICE_GET_CCAVENUE_KEY','userName':'abcd'}";
RequestBody formBody = new FormBody.Builder()
.add("REQUEST_TYPE_SENT","SERVICE_FORGOT_USER_PASSWORD")
.add("phone",strings[1])//"+91 - 9999991212")
.add("device_token","gf")
.add("device_type","2")
.build();
builder.url(strings[1])
.post(formBody)
.build();
Request request = new Request.Builder()
.url(strings[1])
.addHeader("decode","2")
.post(formBody)
.build();
try {
Response response = client.newCall(request).execute();
// JSONObject obj = new JSONObject(response.body().string());
//op[0] = obj.getString("user_id");
writeToFile("response="+response.body().string());
return response.body().string();
}catch (Exception e){
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(String s) {
//Context context = getApplicationContext();
//CharSequence text = s;
//int duration = Toast.LENGTH_SHORT;
//Toast toast = Toast.makeText(context, text, duration);
//toast.show();
// Intent intent = new Intent(getBaseContext(), HomepageNormal.class);
// startActivity(intent);
}