//AsyncTask calling phase from OnCreate method
AsyncTask asyncTask = new AsynTask();
asyncTask.execute();
//doesn't work!!!!//
new AsyncTask().execute();
//works fine!!!//
while calling the first way it is showing errors but as soon as I change it to the next way it works perfectly fine....Why?