{"id":70,"date":"2026-08-14T10:42:52","date_gmt":"2026-08-14T10:42:52","guid":{"rendered":"https:\/\/my.serverhome.ru\/?p=70"},"modified":"2026-08-14T10:57:28","modified_gmt":"2026-08-14T10:57:28","slug":"asynctask-%d0%b4%d0%bb%d1%8f-%d0%b7%d0%b0%d0%b3%d1%80%d1%83%d0%b7%d0%ba%d0%b8-%d0%b8%d0%b7%d0%be%d0%b1%d1%80%d0%b0%d0%b6%d0%b5%d0%bd%d0%b8%d0%b9-%d0%b8-%d1%82%d0%b5%d0%ba%d1%81%d1%82%d0%b0-%d0%b8","status":"publish","type":"post","link":"https:\/\/my.serverhome.ru\/?p=70","title":{"rendered":"AsyncTask \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0437 \u0441\u0435\u0442\u0438 (Java)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u041a\u043e\u0433\u0434\u0430 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0431\u044b\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438, \u0430 \u043a\u043e\u0442\u044b \u0431\u044b\u043b\u0438 \u043a\u043e\u0442\u044f\u0442\u0430\u043c\u0438, \u0442.\u0435. \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 Android 2.3.3 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u043e\u0433 \u043d\u0435 \u043f\u0440\u0438\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043a \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0438\u0437 \u0441\u0435\u0442\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u043c \u043d\u0430 Android 4.0, \u0442\u043e \u043a\u043e\u0434 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043b\u0435\u0442\u0430\u0442\u044c \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0433\u0440\u0430\u0442\u044c \u043f\u043e \u043d\u043e\u0432\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441&nbsp;<strong>AsyncTask<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 Android 11 \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043d \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c. \u041d\u043e \u043f\u0440\u043e\u0441\u043b\u0443\u0436\u0438\u043b \u043e\u043d \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442 \u0432\u0435\u0440\u043e\u0439 \u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u0439. \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0440\u0443\u0442\u0438\u043d \u0432 Kotlin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432&nbsp;<a href=\"https:\/\/developer.alexanderklimov.ru\/android\/theory\/asynctask.php\">\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>. \u041a\u043e\u0440\u043e\u0442\u043a\u043e \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442\u00a0<strong>AsyncTask<\/strong><\/li>\n\n\n\n<li>\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430<\/li>\n\n\n\n<li>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u00a0<strong>execute()<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0432 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435. \u0415\u0441\u043b\u0438 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u0435\u0442\u0438, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,&nbsp;<a href=\"https:\/\/developer.alexanderklimov.ru\/android\/library\/picasso.php\">Picasso<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430.&nbsp;<strong>AsyncTask<\/strong>&nbsp;\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u2013&nbsp;<strong>doInBackground()<\/strong>&nbsp;(\u0434\u0435\u043b\u0430\u0435\u043c \u0432 \u0444\u043e\u043d\u0435). \u0422\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u044b&nbsp;<strong>onPreExecute()<\/strong>&nbsp;(\u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438),&nbsp;<strong>onProgressUpdate()<\/strong>&nbsp;(\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445) \u0438&nbsp;<strong>onPostExecute()<\/strong>&nbsp;(\u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0433\u043e).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>doInBackground()<\/strong>&nbsp;\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u2013 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u0435\u0431-\u0430\u0434\u0440\u0435\u0441\u043e\u0432, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0435\u0442\u043e\u0434&nbsp;<strong>onPreExecute()<\/strong>&nbsp;\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 UI-\u043f\u043e\u0442\u043e\u043a\u0435 \u0434\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430&nbsp;<strong>doInBackground()<\/strong>. \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0435\u0442\u043e\u0434&nbsp;<strong>onPostExecute()<\/strong>&nbsp;\u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0432 UI-\u043f\u043e\u0442\u043e\u043a\u0435 \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f&nbsp;<strong>doInBackground()<\/strong>. \u0422\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043a\u043e\u043d\u0447\u0435\u043d\u0430.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0435\u0442\u043e\u0434&nbsp;<strong>onProgressUpdate()<\/strong>, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 UI-\u043f\u043e\u0442\u043e\u043a\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. \u0415\u0441\u043b\u0438 \u0432&nbsp;<strong>doInBackground()<\/strong>&nbsp;\u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>publishProgress()<\/strong>&nbsp;\u2013 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0435\u043c\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0432&nbsp;<strong>onProgressUpdate()<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?>\n&lt;LinearLayout \n    xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\" >\n\n    &lt;ProgressBar\n        android:id=\"@+id\/progressbar\"\n        style=\"@android:style\/Widget.ProgressBar.Horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_margin=\"10dp\"\n        android:indeterminate=\"false\" \/>\n\n&lt;\/LinearLayout><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0438\u0448\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package ru.alexanderklimov.asynctaskdemo;\n\nimport android.os.AsyncTask;\nimport android.os.Bundle;\nimport android.os.SystemClock;\nimport android.widget.ProgressBar;\nimport android.widget.Toast;\n\nimport androidx.appcompat.app.AppCompatActivity;\n\npublic class MainActivity extends AppCompatActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        setContentView(R.layout.activity_main);\n        \n        new MyAsyncTask().execute();\n    }\n\n    private class MyAsyncTask extends AsyncTask&lt;Void, Integer, Void> {\n\n        private ProgressBar mProgressBar;\n\n        @Override\n        protected void onPreExecute() {\n            super.onPreExecute();\n\n            mProgressBar = (ProgressBar) findViewById(R.id.progressbar);\n        }\n\n        @Override\n        protected Void doInBackground(Void... params) {\n            \/\/ \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e\n            for (int i = 1; i &lt;= 100; i++) {\n                SystemClock.sleep(100);\n                publishProgress(i);\n            }\n            return null;\n        }\n\n        @Override\n        protected void onProgressUpdate(Integer... values) {\n            super.onProgressUpdate(values);\n\n            mProgressBar.setProgress(values&#91;0]);\n        }\n\n        @Override\n        protected void onPostExecute(Void result) {\n            super.onPostExecute(result);\n\n            Toast.makeText(MainActivity.this, \"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430!\",\n                    Toast.LENGTH_LONG).show();\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043b\u0430\u0441\u0441&nbsp;<strong>MyAsyncTask<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442&nbsp;<strong>AsyncTask<\/strong>. \u0412 \u043d\u0451\u043c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. \u0412 \u043c\u0435\u0442\u043e\u0434\u0435&nbsp;<strong>onPreExecute()<\/strong>&nbsp;\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442&nbsp;<strong>ProgressBar<\/strong>. \u0412 \u043c\u0435\u0442\u043e\u0434\u0435&nbsp;<strong>doInBackground(Void\u2026 params)<\/strong>&nbsp;\u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>publishProgress()<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435&nbsp;<strong>doInBackground()<\/strong>, \u0442\u043e \u0432 UI-\u043f\u043e\u0442\u043e\u043a\u0435 \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>onPostExecute()<\/strong>&nbsp;\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>execute()<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0434\u043b\u044f&nbsp;<strong>AsyncTask&lt;Void, Integer, Void&gt;<\/strong>&nbsp;\u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430&nbsp;<strong>Integer<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0418\u0437\u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043f\u0440\u043e\u0435\u043a\u0442, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0437\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434, \u0438 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0430\u0439\u0442\u0435. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u00a0<strong>ImageView<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;ImageView\n    android:id=\"@+id\/web_image\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\" \/><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u043e\u043c, \u0442\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435&nbsp;<strong>android.permission.INTERNET<\/strong>&nbsp;\u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043e\u0431\u043e\u0439\u0434\u0451\u043c\u0441\u044f \u0431\u0435\u0437 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 (\u0445\u043e\u0442\u044f \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c), \u0430 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0438 \u0442\u0440\u0435\u0442\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043b\u044f&nbsp;<strong>AsyncTask<\/strong>&nbsp;&#8212;&nbsp;<strong>AsyncTask&lt;URL, Void, Bitmap&gt;<\/strong>. \u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package ru.alexanderklimov.asynctaskdemo;\n\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.os.AsyncTask;\nimport android.os.Bundle;\nimport android.widget.ImageView;\n\nimport androidx.appcompat.app.AppCompatActivity;\n\nimport java.io.IOException;\nimport java.net.MalformedURLException;\nimport java.net.URL;\n\npublic class MainActivity extends AppCompatActivity {\n\n    private ImageView webImageView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        webImageView = findViewById(R.id.web_image);\n\n        \/\/ \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\n        String imageUrl = \"http:\/\/developer.alexanderklimov.ru\/android\/images\/android_cat.jpg\";\n        URL url;\n\n        try {\n            url = new URL(imageUrl);\n            new MyAsyncTask().execute(url);\n        } catch (MalformedURLException e) {\n            e.printStackTrace();\n        }\n    }\n\n    private class MyAsyncTask extends AsyncTask&lt;URL, Void, Bitmap> {\n\n        @Override\n        protected void onPreExecute() {\n            super.onPreExecute();\n        }\n\n        @Override\n        protected Bitmap doInBackground(URL... urls) {\n            Bitmap networkBitmap = null;\n\n            URL networkUrl = urls&#91;0]; \/\/ \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\n            try {\n                networkBitmap = BitmapFactory.decodeStream(networkUrl\n                        .openConnection().getInputStream());\n            } catch (IOException e) {\n                e.printStackTrace();\n            }\n            return networkBitmap;\n        }\n\n        protected void onPostExecute(Bitmap result) {\n            webImageView.setImageBitmap(result);\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u0438\u0439 (\u043f\u0440\u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438) \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0441 \u0441\u0430\u0439\u0442\u0430.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0435\u0440\u0438\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, \u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u041c\u0435\u0442\u043e\u0434&nbsp;<strong>doInBackground(URL&#8230; urls)<\/strong>&nbsp;\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0440\u0430\u0437\u0443 \u0442\u0440\u0451\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u043d\u0435\u0441\u0451\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?>\n&lt;LinearLayout \n    xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n\n    &lt;ProgressBar\n        android:id=\"@+id\/progressbar\"\n        style=\"@android:style\/Widget.ProgressBar.Horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_margin=\"10dp\"\n        android:indeterminate=\"false\" \/>\n\n    &lt;ImageView\n        android:id=\"@+id\/first_image\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" \/>\n\n    &lt;ImageView\n        android:id=\"@+id\/second_image\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" \/>\n\n    &lt;ImageView\n        android:id=\"@+id\/third_image\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" \/>\n\n&lt;\/LinearLayout><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0442\u0440\u0451\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package ru.alexanderklimov.asynctaskdemo;\n\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.os.AsyncTask;\nimport android.os.Bundle;\nimport android.widget.ImageView;\nimport android.widget.ProgressBar;\nimport android.widget.Toast;\n\nimport androidx.appcompat.app.AppCompatActivity;\n\nimport java.io.IOException;\nimport java.net.MalformedURLException;\nimport java.net.URL;\n\npublic class MainActivity extends AppCompatActivity {\n\n    private ImageView&#91;] mWebImageViews = new ImageView&#91;3]; \/\/ \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u044f \u0442\u0440\u0451\u0445 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        mWebImageViews&#91;0] = findViewById(R.id.first_image);\n        mWebImageViews&#91;1] = findViewById(R.id.second_image);\n        mWebImageViews&#91;2] = findViewById(R.id.third_image);\n\n        ProgressBar progressBar = findViewById(R.id.progressbar);\n\n        \/\/ \u0410\u0434\u0440\u0435\u0441\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\n        String firstImageUrl = \"http:\/\/developer.alexanderklimov.ru\/android\/images\/pinkhellokitty.jpg\";\n        String secondImageUrl = \"http:\/\/developer.alexanderklimov.ru\/android\/images\/keyboard-cat.jpg\";\n        String thirdImageUrl = \"http:\/\/developer.alexanderklimov.ru\/android\/images\/cat-tips.jpg\";\n\n        URL firstUrl, secondUrl, thirdUrl;\n\n        try {\n            firstUrl = new URL(firstImageUrl);\n            secondUrl = new URL(secondImageUrl);\n            thirdUrl = new URL(thirdImageUrl);\n\n            new MyAsyncTask(3, mWebImageViews, progressBar).execute(firstUrl, secondUrl,\n                    thirdUrl);\n\n        } catch (MalformedURLException e) {\n            e.printStackTrace();\n        }\n    }\n\n    private class MyAsyncTask extends AsyncTask&lt;URL, Integer, Void&gt; {\n\n        private ImageView&#91;] mImageViews;\n        private Bitmap&#91;] mBitmaps;\n        private ProgressBar mProgressBar;\n\n        public MyAsyncTask(int numberOfImage, ImageView&#91;] imageViews, ProgressBar progressBar) {\n            mBitmaps = new Bitmap&#91;numberOfImage];\n\n            mImageViews = new ImageView&#91;numberOfImage];\n\n            for (int i = 0; i &lt; numberOfImage; i++) {\n                mImageViews&#91;i] = imageViews&#91;i];\n            }\n\n            \/\/ \u0423\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430\n            \/\/  System.arraycopy(imageViews, 0, mImageViews, 0, numberOfImage);\n\n            mProgressBar = progressBar;\n        }\n\n        @Override\n        protected void onPreExecute() {\n            super.onPreExecute();\n        }\n\n        @Override\n        protected Void doInBackground(URL... urls) {\n            if (urls.length &gt; 0) {\n                for (int i = 0; i &lt; urls.length; i++) {\n                    URL networkUrl = urls&#91;i];\n\n                    try {\n                        mBitmaps&#91;i] = BitmapFactory.decodeStream(networkUrl\n                                .openConnection().getInputStream());\n                    } catch (IOException e) {\n                        e.printStackTrace();\n                    }\n\n                    publishProgress(i);\n\n                    \/\/ \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 (\u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e)\n                    try {\n                        Thread.sleep(200);\n                    } catch (InterruptedException e) {\n                        e.printStackTrace();\n                    }\n                }\n            }\n            return null;\n        }\n\n        protected void onPostExecute(Void result) {\n            Toast.makeText(getBaseContext(), \"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430\",\n                    Toast.LENGTH_LONG).show();\n        }\n\n        @Override\n        protected void onProgressUpdate(Integer... values) {\n            if (values.length &gt; 0) {\n                for (Integer value : values) {\n                    mImageViews&#91;value].setImageBitmap(mBitmaps&#91;value]);\n                    mProgressBar.setProgress(value * 50);\n                }\n            }\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0442\u0440\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441 \u0441\u0430\u0439\u0442\u0430 \u0432\u00a0<strong>ImageView<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0441 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0411\u0443\u0434\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u043f\u043e \u0449\u0435\u043b\u0447\u043a\u0443 \u043a\u043d\u043e\u043f\u043a\u0438. \u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0435\u0449\u0451 \u0436\u0434\u0430\u0442\u044c. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u043a\u0430\u043a \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0430\u0439\u043b\u0430. \u0422\u043e\u0433\u0434\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0430 \u0434\u0438\u0441\u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?>\n&lt;LinearLayout \n    xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n\n    &lt;TextView\n        android:id=\"@+id\/info_textView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_margin=\"10dp\"\/>\n\n    &lt;Button\n        android:id=\"@+id\/download_button\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_margin=\"10dp\"\n        android:text=\"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c\"\n        android:onClick=\"onClick\"\/>\n\n    &lt;ProgressBar\n        android:id=\"@+id\/progressbar\"\n        style=\"@android:style\/Widget.ProgressBar.Horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_margin=\"10dp\">\n    &lt;\/ProgressBar>\n\n    &lt;ImageView\n        android:id=\"@+id\/web_imageView\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\"\/>\n\n&lt;\/LinearLayout><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package ru.alexanderklimov.asynctaskdemo;\n\nimport android.content.Context;\nimport android.graphics.BitmapFactory;\nimport android.os.AsyncTask;\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.view.View;\nimport android.widget.ImageView;\nimport android.widget.ProgressBar;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport java.io.BufferedInputStream;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.net.URL;\nimport java.net.URLConnection;\n\npublic class MainActivity extends AppCompatActivity {\n\n    private TextView mInfoTextView;\n    private ProgressBar mProgressBar;\n    private ImageView mImageView;\n\n    private File directory;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        setContentView(R.layout.activity_main);\n\n        String filePath = \"MyFileStorage\";\n        directory = this.getDir(filePath, Context.MODE_PRIVATE);\n\n        mImageView = findViewById(R.id.web_imageView);\n        mInfoTextView = findViewById(R.id.info_textView);\n        mProgressBar = findViewById(R.id.progressbar);\n\n    }\n\n    public void onClick(View view) {\n        String imageUrl = \"http:\/\/developer.alexanderklimov.ru\/android\/images\/webview3.png\";\n        new GetImageTask().execute(imageUrl);\n    }\n\n    private class GetImageTask extends AsyncTask&lt;String, Integer, String> {\n\n        protected void onPreExecute() {\n            mProgressBar.setProgress(0);\n        }\n\n        protected String doInBackground(String... urls) {\n\n            String filename = \"android_cat.png\";\n            File myFile = new File(directory, filename);\n\n            try {\n                URL url = new URL(urls&#91;0]);\n                URLConnection connection = url.openConnection();\n                connection.connect();\n                int fileSize = connection.getContentLength();\n\n                InputStream is = new BufferedInputStream(url.openStream());\n                OutputStream os = new FileOutputStream(myFile);\n\n                byte data&#91;] = new byte&#91;1024];\n                long total = 0;\n                int count;\n                while ((count = is.read(data)) != -1) {\n                    total += count;\n                    publishProgress((int) (total * 100 \/ fileSize));\n                    os.write(data, 0, count);\n                }\n\n                os.flush();\n                os.close();\n                is.close();\n\n            } catch (Exception e) {\n                e.printStackTrace();\n            }\n            return filename;\n        }\n\n        protected void onProgressUpdate(Integer... progress) {\n            mInfoTextView.setText(String.valueOf(progress&#91;0]) + \"%\");\n            mProgressBar.setProgress(progress&#91;0]);\n        }\n\n        protected void onCancelled() {\n            Toast toast = Toast.makeText(getBaseContext(),\n                    \"Error connecting to Server\", Toast.LENGTH_LONG);\n            toast.show();\n        }\n\n        protected void onPostExecute(String filename) {\n            mProgressBar.setProgress(100);\n            mInfoTextView.setText(\"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430...\");\n            File myFile = new File(directory, filename);\n            mImageView.setImageBitmap(BitmapFactory.decodeFile(myFile\n                    .getAbsolutePath()));\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0438\u0437 \u0441\u0435\u0442\u0438<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441 \u043a\u043e\u0442\u0438\u043a\u0430\u043c\u0438, \u043d\u043e \u0438 \u0442\u0435\u043a\u0441\u0442 \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 \u0441\u0430\u0439\u0442\u0430 \u0432&nbsp;<strong>TextView<\/strong>&nbsp;\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438&nbsp;<strong>AsyncTask<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043c\u0435\u0442\u043e\u043a. \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0432\u043e \u0432\u0442\u043e\u0440\u0443\u044e \u043c\u0435\u0442\u043a\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0442\u0435\u043a\u0441\u0442, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0441 \u0441\u0430\u0439\u0442\u0430 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;LinearLayout \n    xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\n    android:id=\"@+id\/LinearLayout1\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n\n    &lt;TextView\n        android:id=\"@+id\/operation_text\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"\"\n        android:textAppearance=\"?android:attr\/textAppearanceMedium\" \/>\n\n    &lt;TextView\n        android:id=\"@+id\/message_text\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:scrollbarAlwaysDrawVerticalTrack=\"true\"\n        android:scrollbars=\"vertical\"\n        android:text=\"\"\n        android:textAppearance=\"?android:attr\/textAppearanceMedium\" \/>\n&lt;\/LinearLayout><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u0430\u043b\u0435\u0435 \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package ru.alexanderklimov.asynctask;\n\nimport android.os.AsyncTask;\nimport android.os.Bundle;\nimport android.text.method.ScrollingMovementMethod;\nimport android.widget.TextView;\n\nimport androidx.appcompat.app.AppCompatActivity;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.net.URL;\n\npublic class MainActivity extends AppCompatActivity {\n\n    private TextView mInfoTextView, mResultTextView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        mInfoTextView = findViewById(R.id.operation_text);\n        mResultTextView = findViewById(R.id.message_text);\n        mResultTextView.setMovementMethod(new ScrollingMovementMethod());\n\n        mInfoTextView.setText(\"\u041f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435...\");\n\n        new FileReadTask().execute();\n    }\n\n    private class FileReadTask extends AsyncTask&lt;Void, Void, Void> {\n\n        private String mResultText;\n\n        @Override\n        protected Void doInBackground(Void... params) {\n\n            URL url;\n            String source = \"http:\/\/developer.alexanderklimov.ru\/android\/apk\/realcat.txt\";\n\n            try {\n                url = new URL(source);\n                String buffer;\n                BufferedReader bufferReader = new BufferedReader(\n                        new InputStreamReader(url.openStream()));\n\n                while ((buffer = bufferReader.readLine()) != null) {\n                    mResultText += buffer;\n                }\n                bufferReader.close();\n            } catch (IOException e) {\n                e.printStackTrace();\n                mResultText = e.toString();\n            }\n\n            return null;\n        }\n\n        @Override\n        protected void onPostExecute(Void result) {\n            mResultTextView.setText(mResultText);\n            mInfoTextView.setText(\"\u0413\u043e\u0442\u043e\u0432\u043e!\");\n\n            super.onPostExecute(result);\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u0434\u043b\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0431\u0443\u0444\u0435\u0440. \u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e. \u041e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0447\u0435\u0440\u0435\u0437&nbsp;<strong>URLConnection<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0440\u0443\u0433\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class UrlConnectionTask extends AsyncTask&lt;String, Void, String&gt; {\n\n    @Override\n    protected String doInBackground(String... params) {\n\n        String result = \"\";\n\n        try {\n            URL url = new URL(params&#91;0]);\n            URLConnection urlConnection = url.openConnection();\n            InputStream inputStream = urlConnection.getInputStream();\n            InputStreamReader inputStreamReader =\n                    new InputStreamReader(inputStream);\n            BufferedReader bufferedReader = \n                    new BufferedReader(inputStreamReader);\n\n            String line;\n            while ((line = bufferedReader.readLine()) != null) {\n                result += line;\n            }\n\n        } catch (IOException e) {\n            e.printStackTrace();\n        }\n        return result;\n    }\n\n    @Override\n    protected void onPostExecute(String result) {\n        mResultTextView.setText(result);\n\n        mInfoTextView.setText(\"\u0413\u043e\u0442\u043e\u0432\u043e!\");\n\n        super.onPostExecute(result);\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>UrlConnectionTask urlConnectionTask = new UrlConnectionTask();\nString source = \"http:\/\/developer.alexanderklimov.ru\/android\/apk\/realcat.txt\";\nurlConnectionTask.execute(source);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u043e\u0433\u0434\u0430 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0431\u044b\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438, \u0430 \u043a\u043e\u0442\u044b \u0431\u044b\u043b\u0438 \u043a\u043e\u0442\u044f\u0442\u0430\u043c\u0438, \u0442.\u0435. \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 Android 2.3.3 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u043e\u0433 &hellip; <a title=\"AsyncTask \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0437 \u0441\u0435\u0442\u0438 (Java)\" class=\"hm-read-more\" href=\"https:\/\/my.serverhome.ru\/?p=70\"><span class=\"screen-reader-text\">AsyncTask \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0437 \u0441\u0435\u0442\u0438 (Java)<\/span>\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435<\/a><\/p>\n","protected":false},"author":1,"featured_media":71,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[18,16,17],"class_list":["post-70","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android","tag-asynctask","tag-java"],"_links":{"self":[{"href":"https:\/\/my.serverhome.ru\/index.php?rest_route=\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/my.serverhome.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/my.serverhome.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/my.serverhome.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/my.serverhome.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70"}],"version-history":[{"count":1,"href":"https:\/\/my.serverhome.ru\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":72,"href":"https:\/\/my.serverhome.ru\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions\/72"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/my.serverhome.ru\/index.php?rest_route=\/wp\/v2\/media\/71"}],"wp:attachment":[{"href":"https:\/\/my.serverhome.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/my.serverhome.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/my.serverhome.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}