I am using the following code:
//(...)
translationTextView.setText(\"Searching for translation...\");
translationTextView.setVisibility(View.VISIBLE);
myAsyncTa
It is called but then you call
translationTextView.setText(translateTask.get() + "
");
and get()
is a blocking call
Try instead to set the text in your onPostExecute()
. If I understand you correctly then something like this should give you what you want
//(...)
translationTextView.setText("Searching for translation...");
translationTextView.setVisibility(View.VISIBLE);
myAsyncTask = (MyAsyncTask) new MyAsyncTask().execute(someString);
Then, assuming MyAsyncTask
is an inner class of your Activity
call translationTextView.setText()
inserting whatever you are trying to return from doInBackground()