{"id":973,"date":"2026-01-31T13:27:49","date_gmt":"2026-01-31T13:27:49","guid":{"rendered":"https:\/\/nurlandroid.com\/?p=973"},"modified":"2026-01-31T13:27:51","modified_gmt":"2026-01-31T13:27:51","slug":"%d0%b2-%d1%87%d1%91%d0%bc-%d1%80%d0%b0%d0%b7%d0%bd%d0%b8%d1%86%d0%b0-%d0%bc%d0%b5%d0%b6%d0%b4%d1%83-remember-%d0%b8-remembersaveable-%d0%ba%d0%be%d0%b3%d0%b4%d0%b0-%d0%b8%d1%81%d0%bf%d0%be%d0%bb","status":"publish","type":"post","link":"https:\/\/nurlandroid.com\/?p=973","title":{"rendered":"\u0412 \u0447\u0451\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 remember \u0438 rememberSaveable? \u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439?"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 <code>remember<\/code><\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n@Composable\nfun Counter() {\n    var count by remember { mutableStateOf(0) }\n    ...\n}\n<\/pre><\/div>\n\n\n<p><code><strong>remember<\/strong><\/code> \u0445\u0440\u0430\u043d\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <strong>\u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438<\/strong> (\u0432 slot table), \u0436\u0438\u0432\u0451\u0442, \u043f\u043e\u043a\u0430 <strong>\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 Composition<\/strong> \u0438 <strong>\u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438<\/strong>. \u041d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <strong>\u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f<\/strong>, \u043a\u043e\u0433\u0434\u0430: Composable \u0432\u044b\u0448\u0435\u043b \u0438\u0437 \u0434\u0435\u0440\u0435\u0432\u0430 (\u0432\u0435\u0442\u043a\u0430 <code>if<\/code> \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u043b\u0430\u0441\u044c, \u0441\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u044d\u043a\u0440\u0430\u043d \u0438 \u0442.\u043f.) \u0438\u043b\u0438 Activity\/Process \u0431\u044b\u043b \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u044d\u043a\u0440\u0430\u043d\u0430).<\/p>\n\n\n\n<p><code><strong>remember<\/strong><\/code> \u043a\u0430\u043a \u0431\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 &#171;\u043f\u043e\u043c\u043d\u0438, \u043f\u043e\u043a\u0430 \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a UI \u0436\u0438\u0432\u0451\u0442&#187;.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 <code>rememberSaveable<\/code><\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n@Composable\nfun Counter() {\n    var count by rememberSaveable { mutableStateOf(0) }\n    ...\n}\n<\/pre><\/div>\n\n\n<p><code><strong>rememberSaveable<\/strong><\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a <code>remember<\/code>, <strong>\u043d\u043e \u043f\u043e\u0432\u0435\u0440\u0445 \u044d\u0442\u043e\u0433\u043e<\/strong> \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 <code>SavedStateRegistry<\/code> \/ <code>Bundle<\/code>. <code><strong>rememberSaveable<\/strong><\/code> \u0443\u043c\u0435\u0435\u0442 <strong>\u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f<\/strong> \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u044d\u043a\u0440\u0430\u043d\u0430 (configuration change) \u0438 \u043f\u043e\u0441\u043b\u0435 recreate Activity (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u0431\u0438\u043b\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0430 \u043d\u0430\u0437\u0430\u0434 \u0441 savedInstanceState). \u041d\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 \u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f \u0432 <code>Bundle<\/code>:<br><code>Int<\/code>, <code>Long<\/code>, <code>String<\/code>, <code>Boolean<\/code>, <code>List<\/code> \u044d\u0442\u0438\u0445 \u0442\u0438\u043f\u043e\u0432, <code>Parcelable<\/code>, <code>Serializable<\/code> \u0438 \u0442.\u0434.<\/p>\n\n\n\n<p><code><strong><code><strong>rememberSaveable<\/strong><\/code><\/strong><\/code> \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 &#171;\u043f\u043e\u043c\u043d\u0438, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u044d\u043a\u0440\u0430\u043d \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043b\u0438\u201d&#187;.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435<\/h4>\n\n\n\n<p><strong><code>remember<\/code>:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Initial composition => \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043b \u0431\u043b\u043e\u043a, \u043f\u043e\u043b\u043e\u0436\u0438\u043b \u0432 \u0441\u043b\u043e\u0442<\/li>\n\n\n\n<li>Recomposition => \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0435\u0440\u0451\u0442 \u0438\u0437 \u0441\u043b\u043e\u0442\u0430, \u0431\u043b\u043e\u043a \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f<\/li>\n\n\n\n<li>Composable \u0432\u044b\u0448\u0435\u043b \u0438\u0437 Composition => \u0441\u043b\u043e\u0442 \u0443\u0434\u0430\u043b\u0451\u043d => \u0441\u0442\u0435\u0439\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d<\/li>\n\n\n\n<li>Activity \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043b\u0438 (rotate) => \u0432\u0441\u0451 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0443\u043b\u044f<\/li>\n<\/ul>\n\n\n\n<p><strong><code>rememberSaveable<\/code>:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Initial composition => \u043a\u0430\u043a <code>remember<\/code>, \u043f\u043b\u044e\u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 Saver<\/li>\n\n\n\n<li>\u041f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0441\u0442\u0435\u0439\u0442\u0430 (<code>onSaveInstanceState<\/code>) => \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0434\u0451\u0442\u0441\u044f \u0432 Bundle<\/li>\n\n\n\n<li>\u041f\u0440\u0438 recreate => \u0438\u0437 Bundle \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043a\u043b\u0430\u0434\u0451\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0441\u043b\u043e\u0442<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 remember remember \u0445\u0440\u0430\u043d\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438 (\u0432 slot table), \u0436\u0438\u0432\u0451\u0442, \u043f\u043e\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 Composition \u0438 \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u041d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430: Composable \u0432\u044b\u0448\u0435\u043b \u0438\u0437 \u0434\u0435\u0440\u0435\u0432\u0430 (\u0432\u0435\u0442\u043a\u0430 if \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u043b\u0430\u0441\u044c, \u0441\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u044d\u043a\u0440\u0430\u043d \u0438 \u0442.\u043f.) \u0438\u043b\u0438 Activity\/Process \u0431\u044b\u043b \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u044d\u043a\u0440\u0430\u043d\u0430). remember \u043a\u0430\u043a \u0431\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 &#171;\u043f\u043e\u043c\u043d\u0438, \u043f\u043e\u043a\u0430 \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a UI \u0436\u0438\u0432\u0451\u0442&#187;. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-973","post","type-post","status-publish","format-standard","hentry","category-compose"],"_links":{"self":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/973","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=973"}],"version-history":[{"count":1,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/973\/revisions"}],"predecessor-version":[{"id":974,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/973\/revisions\/974"}],"wp:attachment":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}