{"id":812,"date":"2025-07-25T03:16:29","date_gmt":"2025-07-25T03:16:29","guid":{"rendered":"https:\/\/nurlandroid.com\/?p=812"},"modified":"2025-07-25T03:16:30","modified_gmt":"2025-07-25T03:16:30","slug":"%d0%ba%d0%b0%d0%ba%d0%b8%d0%b5-%d0%ba%d0%be%d0%bc%d0%bf%d0%be%d0%bd%d0%b5%d0%bd%d1%82%d1%8b-%d1%80%d0%b5%d0%b0%d0%b3%d0%b8%d1%80%d1%83%d1%8e%d1%82-%d0%bd%d0%b0-%d1%81%d0%bc%d0%b5%d0%bd%d1%83-%d0%ba","status":"publish","type":"post","link":"https:\/\/nurlandroid.com\/?p=812","title":{"rendered":"\u041a\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442 \u043d\u0430 \u0441\u043c\u0435\u043d\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438?"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u043c\u0435\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438?<\/h4>\n\n\n\n<p>\u0421\u043c\u0435\u043d\u0430 <strong>orientation<\/strong>, \u044f\u0437\u044b\u043a\u0430, \u0442\u0435\u043c\u044b, DPI, UI Mode, fontScale \u0438 \u0434\u0440.<br>Android \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 <strong>\u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c UI.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u041a\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442 \u043d\u0430 \u0441\u043c\u0435\u043d\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438?<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">1. <code>Activity<\/code><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f<\/strong>: \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>onPause() => onStop() <code>=><\/code> onDestroy()<\/code>, \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e <code>onCreate()<\/code><\/li>\n\n\n\n<li>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 <code>Resources.Configuration<\/code><\/li>\n\n\n\n<li><code>onSaveInstanceState()<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u0435\u043c<\/li>\n<\/ul>\n\n\n\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <strong>\u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442<\/strong> \u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0442\u044b \u044f\u0432\u043d\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. <code>Fragment<\/code><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430 <code>Activity<\/code>: <strong>\u0435\u0433\u043e <code>View<\/code> \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u0442\u0441\u044f<\/strong>, \u043d\u043e \u0441\u0430\u043c <code>Fragment<\/code> \u043c\u043e\u0436\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 (\u0435\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 back stack)<\/li>\n\n\n\n<li>\u0416\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b: nginx\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<code>onPause <code>=><\/code> onStop <code>=><\/code> onDestroyView <code>=><\/code> onCreateView <code>=><\/code> onStart <code>=><\/code> onResume<\/code><\/li>\n<\/ul>\n\n\n\n<p>\u041c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>setRetainInstance(true)<\/code> (\u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431) \u0438\u043b\u0438 <code>ViewModel<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0436\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3. <code>View<\/code><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u041f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e<\/strong>, \u0435\u0441\u043b\u0438 <code>Activity<\/code> \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0430<\/li>\n\n\n\n<li>\u0418\u0437\u043c\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0438 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e \u0447\u0435\u0440\u0435\u0437 <code>onMeasure()<\/code> \/ <code>onLayout()<\/code> \/ <code>onDraw()<\/code><\/li>\n\n\n\n<li><code>CustomView<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u044f\u0437\u044b\u043a\u0430 \u0438 \u0442.\u043f.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">4. <code>ViewModel<\/code><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f<\/strong> \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/li>\n\n\n\n<li>\u041f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u043c\u0443 \u0446\u0438\u043a\u043b\u0443 <code>ViewModelStoreOwner<\/code> (<code>Activity<\/code> \u0438\u043b\u0438 <code>Fragment<\/code>)<\/li>\n\n\n\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f <strong>\u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f\u043c\u0438 UI.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5. <code>Service<\/code><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u041d\u0435 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442<\/strong> \u043d\u0430 \u0441\u043c\u0435\u043d\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/li>\n\n\n\n<li>\u0416\u0438\u0432\u0451\u0442 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 UI<\/li>\n\n\n\n<li>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 <code>Activity<\/code> \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0430, <code>Service<\/code> \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">6. <code>BroadcastReceiver<\/code>, <code>ContentProvider<\/code><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u041d\u0435 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f<\/strong> \u043f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/li>\n\n\n\n<li>\u0415\u0441\u043b\u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 <code>Manifest<\/code> \u0438-\u0438\u043b\u0438 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 UI<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u043c\u0435\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438? \u0421\u043c\u0435\u043d\u0430 orientation, \u044f\u0437\u044b\u043a\u0430, \u0442\u0435\u043c\u044b, DPI, UI Mode, fontScale \u0438 \u0434\u0440.Android \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c UI. \u041a\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442 \u043d\u0430 \u0441\u043c\u0435\u043d\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438? 1. Activity \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0442\u044b \u044f\u0432\u043d\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. 2. Fragment \u041c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c setRetainInstance(true) (\u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431) \u0438\u043b\u0438 ViewModel, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0436\u0438\u0442\u044c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-812","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=812"}],"version-history":[{"count":1,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/812\/revisions"}],"predecessor-version":[{"id":813,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/812\/revisions\/813"}],"wp:attachment":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}