The question is simple. Actually When I try to toast message, It is not getting displayed. Could you please guide me to resolve this.
protected String doInBackground(Void... params) {
if (result.equals("200")) {
Toast.makeText(CallArduino,appliance + " Success ",Toast.LENGTH_LONG).show();
}else {
Toast.makeText(CallArduino, "Failed", Toast.LENGTH_SHORT).show();
}
return "success";
}
Toastcan’t be shown in background thread you should call it within the UI thread, inonPostExecute()for example