From e19e61a069874cddc8757f27f087c05975f7b4b7 Mon Sep 17 00:00:00 2001 From: Calega Date: Wed, 27 Jul 2016 12:44:22 -0300 Subject: [PATCH] Method get text should be called from Ui Thread - Changed String declaration from doInBackground method to RetrieveFeedTask variables definition. --- .../main/java/com/sample/foo/simplewebapi/MainActivity.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/sample/foo/simplewebapi/MainActivity.java b/app/src/main/java/com/sample/foo/simplewebapi/MainActivity.java index d1d5d60..2691d67 100644 --- a/app/src/main/java/com/sample/foo/simplewebapi/MainActivity.java +++ b/app/src/main/java/com/sample/foo/simplewebapi/MainActivity.java @@ -50,14 +50,15 @@ public void onClick(View v) { class RetrieveFeedTask extends AsyncTask { private Exception exception; - + String email = emailText.getText().toString(); + protected void onPreExecute() { progressBar.setVisibility(View.VISIBLE); responseView.setText(""); } protected String doInBackground(Void... urls) { - String email = emailText.getText().toString(); + // Do some validation here try {