I have a simple application which sends an image (Base64 encoded) to a server, the server gets this data fine because the PHP script sends me an email with the Base64 Data attached. However, after the task gets completed the toast never shows. How do I take the Toast get shown after the data gets posted?
I think the issue is within the context.
UPDATE
I have updated the link, because i have since moved the upload logic into a different .java file.
Your sample look OK. If Activity, to which mContext variable belongs is currently active, it should show. Not in other case.
try this modification:
http://developer.android.com/guide/topics/ui/notifiers/toasts.html
Android toast.makeText context error
EDIT: WRONG TYPE DECLARATION OF AsyncTask
your
AsyncTaskdeclaration looks likeclass UploadImage extends AsyncTask<String, Void, String>This means:
doInBackground(String... arg)doInBackgroundtoonPostExecuteSo change your
onPostExecutedeclaration to this:or change return type of
doInBackgroundto<Bitmap>and change class declaration to:class UploadImage extends AsyncTask<String, Void, Bitmap>http://developer.android.com/reference/android/os/AsyncTask.html