From: Wootak Jung Date: Tue, 26 Sep 2023 06:02:09 +0000 (+0900) Subject: Fix NullReferenceException occured issue X-Git-Tag: accepted/tizen/8.0/unified/20231007.143440~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=749ca9a9cd0907a09ff75a1d7f50f6205ea90b6c;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Fix NullReferenceException occured issue issue occured when using mScanButton before ProvideMoreActions called Change-Id: I071ec97915211aa1b87f183ca2bf058ba8654270 Signed-off-by: Wootak Jung --- diff --git a/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs b/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs index af9a729..39ff969 100644 --- a/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs +++ b/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs @@ -42,6 +42,16 @@ namespace SettingBluetooth Log.Info(LogTag, "OnCreate"); base.OnCreate(); Resources.SetPath(GetResourcePath("/")); + + ViewStyle viewStyle = GetButtonViewStyle(); + mScanButton = new Button() + { + Text = Resources.IDS_BT_SK_SCAN, + IsEnabled = BtModel.IsEnabled, + }; + mScanButton.Clicked += AdapterController.ScanButtonClicked; + mScanButton.ApplyStyle(viewStyle); + return BtMainView.Create(); } @@ -59,16 +69,6 @@ namespace SettingBluetooth public override IEnumerable ProvideMoreActions() { - ViewStyle viewStyle = GetButtonViewStyle(); - - mScanButton = new Button() - { - Text = Resources.IDS_BT_SK_SCAN, - IsEnabled = BtModel.IsEnabled, - }; - mScanButton.Clicked += AdapterController.ScanButtonClicked; - mScanButton.ApplyStyle(viewStyle); - return new View[] { mScanButton }; } diff --git a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk index 9cf047f..be7265f 100644 Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk differ