I'm developing an application on Android that receives data from a webservice (Json php).
The structure of the project: To get the data I'm using asynctask, I have a progressbar in the preExecute and in the proExecute it visualizes the data. The 'asynctask' class is called in onCreate ().
Problems: The passage of the data from the webservice to the android takes a lot and progresses too and if the user turns the screen, it restarts the search, and this makes the application annoying.
How do I solve this problem? What is the technique used in applications like WhatsSap or the messanger?