Change Navigator Pop() code to use Bundle by sending message 37/282637/1 accepted/tizen/unified/20221007.171847
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 7 Oct 2022 06:30:26 +0000 (15:30 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 7 Oct 2022 06:33:40 +0000 (15:33 +0900)
- If only Navigator.Pop(), the widget just shows a black screen when
Back button.
- So, changed to use Bundle API and update Content info.

Change-Id: I88fed3b4ac321023ae27f44fd359f80474fc44e1
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
Settings/SettingAccessibility/SettingWidgetAccessibility.cs

index 9ee614f5f176b5c4ae1abf9d1cf040c4bcf9c032..020b39f114308468a1936f6e96e45db74c0cef23 100755 (executable)
@@ -47,7 +47,8 @@ namespace SettingAccessibility
 \r
             backButton.Clicked += (object source, ClickedEventArgs args) =>\r
             {\r
-                navigator.Pop();\r
+                // Instead of using `navigator.Pop();` code\r
+                RequestWidgetPop();\r
             };\r
 \r
             appBar.NavigationContent = backButton;\r
@@ -160,6 +161,15 @@ namespace SettingAccessibility
             settingScroll.Add(label);\r
         }\r
 \r
+        protected void RequestWidgetPop()\r
+        {\r
+            // Update Widget Content by sending message to pop the fourth page.\r
+            Bundle nextBundle = new Bundle();\r
+            nextBundle.AddItem("WIDGET_ACTION", "POP");\r
+            String encodedBundle = nextBundle.Encode();\r
+            SetContentInfo(encodedBundle);\r
+        }\r
+\r
         protected override void OnPause()\r
         {\r
             base.OnPause();\r