I did added async library at my project and checked already, I don\'t know why code flow doesn\'t go in to asynctask
Code
public void doMysql()
{
Log
You should execute your task with executor
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
Because in lower versions of Android all AsyncTasks were executed at single background thread. So new tasks might be waiting, until other task working.
In lower versions in Android (actually on pre-HONEYCOMB) you can't execute AsyncTask on executor.
Change your code to
public void executeAsyncTask()
{
AsyncTask task = new AsyncTask() {
@Override
protected void onPreExecute() {
super.onPreExecute();
Log.e("AsyncTask", "onPreExecute");
}
@Override
protected String doInBackground(Void... params) {
Log.v("AsyncTask", "doInBackground");
String msg = null;
// some calculation logic of msg variable
return msg;
}
@Override
protected void onPostExecute(String msg) {
Log.v("AsyncTask", "onPostExecute");
}
};
if(Build.VERSION.SDK_INT >= 11/*HONEYCOMB*/) {
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
task.execute();
}
}