Change behavior of AsyncTask and much more other changes in MainPage.

Bug fixes and more adequate work of main activity.