Something I do not understand what's the matter ...
I load the data in the portions and I display the list. If you change the orientation of the screen when loading data, the exception is "IllegalArgumentException:
How to get rid of it?
And one more question: after loading another piece of data, changing the orientation of the screen, and then all the loaded data disappears and the list starts to load again, from the very beginning.
class NetWork extends AsyncTask<String, Integer, Void> { protected ProgressDialog proDialog; @Override protected void onPreExecute() { proDialog = new ProgressDialog(EngineBrowseByOnline.this); proDialog.setMessage("Loading search engines..."); proDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); proDialog.setCancelable(true); proDialog.show(); } @Override protected Void doInBackground(String... params) { rsj = new ReadStringJson(SERVER_URL + SERVER_PATH_1 + "from=" + (from+1) + "&number=" + number + SERVER_PATH_2 + GROUP); try { // здесь идет парсинг json и заполнение names, // descriptions и logoUrl parsingData(rsj.readFromServer()); } catch (IOException ex) { Log.e("IOException: ", ex.toString()); ex.printStackTrace(); } catch (JSONException ex) { Log.e("JSONException: ", ex.toString()); ex.printStackTrace(); } return null; } @Override protected void onPostExecute(Void result) { super.onPostExecute(result); adapter.addEnginesNames(names); adapter.addEnginesDescriptions(descriptions); adapter.addEnginesLogoUrl(logoUrl); adapter.notifyDataSetChanged(); proDialog.dismiss(); } }