2016-06-02 4 views
2

MVVMCross 4.1.6(4.1.4も試しました)を使用し、観察可能なコレクション内の項目のプロパティに問題があります。これは、私はMvxRecyclerViewと一緒に接続されている項目のリストをそれぞれ私の2つのタブを繰り返し切り替えるときに発生します。基本的に1つは普通のリストであり、1つは推薦リストです。MvxNotifyPropertyChangedアプリケーションSetPropertyでクラッシュする

フラグメントは、すべての新しいデータが表示されることをわからないために、この方法で現れたときにこれらのリストの両方がバックグラウンドでデータを取得することにより調製:

private void updateChannels() 
{ 
    foreach (var category in CalCategories) 
    { 
     if (string.IsNullOrEmpty(m_searchString)) 
     { 
      var channels = category.Channels.Where(o => o.Task == null).ToList(); 
      if (category.Count != channels.Count) 
      { 
       category.Count = channels.Count; 
      } 

      if (channels.Count > 0) 
      { 
       if (!CalChannelList.Contains(category)) 
       { 
        CalChannelList.Add(category); 
       } 
       if (category.Expanded) 
       { 
        foreach (var channel in channels) 
        { 
         if (!CalChannelList.Contains(channel)) 
         { 
          CalChannelList.Add(channel); 
         } 
        } 
       } 
      } 
     } 
     else 
     { 
      var channels = category.Channels.Where(o => o.Name.Contains(SearchString) && o.Task == null).ToList(); 
      if (category.Count != channels.Count) 
      { 
       category.Count = channels.Count; 
      } 
      if (channels.Count > 0) 
      { 
       if (!CalChannelList.Contains(category)) 
       { 
        CalChannelList.Add(category); 
       } 
       if (category.Expanded) 
       { 
        foreach (var channel in channels) 
        { 
         if (!CalChannelList.Contains(channel)) 
         { 
          CalChannelList.Add(channel); 
         } 
        } 
       } 
      } 
     } 
    } 
} 

誤差は一定の時間が経過するが発生タブ間を前後に切り替えるだけで、category.Countが設定されたときに常に行に表示されます。

Stacktrace: 

    at <unknown> <0xffffffff> 
    at (wrapper managed-to-native) object.wrapper_native_0xb4ecb6f9 (intptr,intptr,intptr,Android.Runtime.JValue*) <IL 0x0002a, 0xffffffff> 
    at (wrapper delegate-invoke) <Module>.invoke_void_intptr_intptr_intptr_JValue* (intptr,intptr,intptr,Android.Runtime.JValue*) <IL 0x0007d, 0xffffffff> 
    at Android.Runtime.JNIEnv.CallVoidMethod (intptr,intptr,Android.Runtime.JValue*) [0x00040] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:567 
    at Android.Widget.TextView.set_TextFormatted (Java.Lang.ICharSequence) [0x0004b] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:3237 
    at Android.Widget.TextView.set_Text (string) [0x00013] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:3248 
    at MvvmCross.Binding.Droid.Target.MvxTextViewTextTargetBinding.SetValueImpl (object,object) <IL 0x0000c, 0x000ab> 
    at MvvmCross.Binding.Bindings.Target.MvxConvertingTargetBinding.SetValue (object) [0x00088] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\Target\MvxConvertingTargetBinding.cs:61 
    at MvvmCross.Binding.Bindings.MvxFullBinding.UpdateTargetFromSource (object) [0x00024] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\MvxFullBinding.cs:156 
    at MvvmCross.Binding.Bindings.MvxFullBinding.<CreateSourceBinding>b__15_0 (object,System.EventArgs) [0x0000c] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\MvxFullBinding.cs:85 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxSourceStep.SendSourcePropertyChanged() [0x00006] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxSourceStep.cs:119 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxCombinerSourceStep.SubStepOnChanged (object,System.EventArgs) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxCombinerSourceStep.cs:107 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxSourceStep.SendSourcePropertyChanged() [0x00006] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxSourceStep.cs:119 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxCombinerSourceStep.SubStepOnChanged (object,System.EventArgs) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxCombinerSourceStep.cs:107 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxSourceStep.SendSourcePropertyChanged() [0x00006] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxSourceStep.cs:119 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxCombinerSourceStep.SubStepOnChanged (object,System.EventArgs) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxCombinerSourceStep.cs:107 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxSourceStep.SendSourcePropertyChanged() [0x00006] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxSourceStep.cs:119 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxPathSourceStep.SourceBindingOnChanged (object,System.EventArgs) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxPathSourceStep.cs:71 
    at MvvmCross.Binding.Bindings.Source.MvxSourceBinding.FireChanged() [0x00006] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\Source\MvxSourceBinding.cs:36 
    at MvvmCross.Binding.Bindings.Source.Leaf.MvxLeafPropertyInfoSourceBinding.OnBoundPropertyChanged() [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\Source\Leaf\MvxLeafPropertyInfoSourceBinding.cs:29 
    at MvvmCross.Binding.Bindings.Source.MvxPropertyInfoSourceBinding.SourcePropertyChanged (object,System.ComponentModel.PropertyChangedEventArgs) [0x00020] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\Source\MvxPropertyInfoSourceBinding.cs:88 
    at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <IL 0x00062, 0xffffffff> 
    at <unknown> <0xffffffff> 
    at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <IL 0x00034, 0xffffffff> 
    at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00038] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:295 
    at System.Reflection.MethodBase.Invoke (object,object[]) [0x00000] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/reflection/methodbase.cs:277 
    at MvvmCross.Platform.WeakSubscription.MvxWeakEventSubscription`2<TKey_REF, TValue_REF>.OnSourceEvent (object,TValue_REF) [0x0000f] in D:\git\MvvmCross\MvvmCross\Platform\Platform\WeakSubscription\MvxWeakEventSubscription.cs:75 
    at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) <IL 0x00074, 0xffffffff> 
    at MvvmCross.Core.ViewModels.MvxNotifyPropertyChanged/<>c__DisplayClass10_0.<RaisePropertyChanged>b__0() <IL 0x0001c, 0x000a7> 
    at MvvmCross.Droid.Views.MvxAndroidMainThreadDispatcher.RequestMainThreadAction (System.Action) <IL 0x0001f, 0x00133> 
    at MvvmCross.Platform.Core.MvxMainThreadDispatchingObject.InvokeOnMainThread (System.Action) [0x00000] in D:\git\MvvmCross\MvvmCross\Platform\Platform\Core\MvxMainThreadDispatchingObject.cs:18 
    at MvvmCross.Core.ViewModels.MvxNotifyPropertyChanged.RaisePropertyChanged (System.ComponentModel.PropertyChangedEventArgs) <IL 0x00044, 0x00277> 
    at MvvmCross.Core.ViewModels.MvxNotifyPropertyChanged.RaisePropertyChanged (string) <IL 0x00009, 0x000b3> 
    at MvvmCross.Core.ViewModels.MvxNotifyPropertyChanged.SetProperty<int> (int&,int,string) <IL 0x00023, 0x00147> 
    at XCPCore.Models.BaseCategory.set_Count (int) [0x00001] in w:\DevWA\MobileXCP~BARONDST\MobileXCP\MobileXcp\MobileXcp.XcpCore\Models\BaseCategory.cs:36 
    at XCPCore.ViewModels.Meas.ConfigInViewModel.updateChannels() [0x00149] in w:\DevWA\MobileXCP~BARONDST\MobileXCP\MobileXcp\MobileXcp.XcpCore\ViewModels\Meas\ConfigInViewModel.cs:209 
    at XCPCore.ViewModels.Meas.ConfigInViewModel.set_SearchString (string) [0x00043] in w:\DevWA\MobileXCP~BARONDST\MobileXCP\MobileXcp\MobileXcp.XcpCore\ViewModels\Meas\ConfigInViewModel.cs:158 
    at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x0005a, 0xffffffff> 
    at <unknown> <0xffffffff> 
    at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <IL 0x00034, 0xffffffff> 
    at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00038] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:295 
    at System.Reflection.MonoProperty.SetValue (object,object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x0006a] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/corlib/System.Reflection/MonoProperty.cs:445 
    at System.Reflection.PropertyInfo.SetValue (object,object,object[]) [0x00000] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/corlib/System.Reflection/PropertyInfo.cs:111 
    at MvvmCross.Binding.Bindings.Source.Leaf.MvxLeafPropertyInfoSourceBinding.SetValue (object) [0x00060] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\Source\Leaf\MvxLeafPropertyInfoSourceBinding.cs:83 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxPathSourceStep.SetSourceValue (object) [0x0001b] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxPathSourceStep.cs:85 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxSourceStep.SetValue (object) [0x0001a] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxSourceStep.cs:70 
    at MvvmCross.Binding.Bindings.MvxFullBinding.UpdateSourceFromTarget (object) [0x00013] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\MvxFullBinding.cs:179 
    at MvvmCross.Binding.Bindings.MvxFullBinding.<CreateTargetBinding>b__18_0 (object,MvvmCross.Binding.Bindings.Target.MvxTargetChangedEventArgs) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\MvxFullBinding.cs:140 
    at MvvmCross.Binding.Bindings.Target.MvxTargetBinding.FireValueChanged (object) [0x00006] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\Target\MvxTargetBinding.cs:32 
    at MvvmCross.Binding.Bindings.Target.MvxConvertingTargetBinding.FireValueChanged (object) [0x0003f] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\Target\MvxConvertingTargetBinding.cs:93 
    at MvvmCross.Binding.Droid.Target.MvxSearchViewQueryTextTargetBinding.HandleQueryTextChanged (object,Android.Widget.SearchView/QueryTextChangeEventArgs) <IL 0x00019, 0x0014f> 
    at Android.Widget.SearchView/IOnQueryTextListenerImplementor.OnQueryTextChange (string) [0x00017] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.SearchView.cs:322 
    at Android.Widget.SearchView/IOnQueryTextListenerInvoker.n_OnQueryTextChange_Ljava_lang_String_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.SearchView.cs:207 
    at (wrapper dynamic-method) object.bf5df6e6-8c4e-4c9b-b90b-f3b9d377de80 (intptr,intptr,intptr) <IL 0x00017, 0x0004b> 
    at (wrapper native-to-managed) object.bf5df6e6-8c4e-4c9b-b90b-f3b9d377de80 (intptr,intptr,intptr) <IL 0x00029, 0xffffffff> 

Attempting native Android stacktrace: 

at ???+0 [0x6fe827f8] 
at ???+0 [0x3f7ffffc] 

================================================================= 
Got a SIGSEGV while executing native code. This usually indicates 
a fatal error in the mono runtime or one of the native libraries 
used by your application. 
================================================================= 
06-02 12:24:13.942 E/mono-rt (6344): 

更新

は、バインディングに関連しているように見えるとUI要素を更新:SearchViewので、リスト全体を変更する場合

Stacktrace: 

    at <unknown> <0xffffffff> 
    at (wrapper managed-to-native) object.wrapper_native_0xb4ecb6f9 (intptr,intptr,intptr,Android.Runtime.JValue*) <IL 0x0002a, 0xffffffff> 
    at (wrapper delegate-invoke) <Module>.invoke_void_intptr_intptr_intptr_JValue* (intptr,intptr,intptr,Android.Runtime.JValue*) <IL 0x0007d, 0xffffffff> 
    at Android.Runtime.JNIEnv.CallVoidMethod (intptr,intptr,Android.Runtime.JValue*) [0x00040] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:567 
    at Android.Widget.TextView.set_TextFormatted (Java.Lang.ICharSequence) [0x0004b] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:3237 
    at Android.Widget.TextView.set_Text (string) [0x00013] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.TextView.cs:3248 
    at MvvmCross.Binding.Droid.Target.MvxTextViewTextTargetBinding.SetValueImpl (object,object) <IL 0x0000c, 0x000ab> 
    at MvvmCross.Binding.Bindings.Target.MvxConvertingTargetBinding.SetValue (object) [0x00088] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\Target\MvxConvertingTargetBinding.cs:61 
    at MvvmCross.Binding.Bindings.MvxFullBinding.UpdateTargetFromSource (object) [0x00024] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\MvxFullBinding.cs:156 
    at MvvmCross.Binding.Bindings.MvxFullBinding.<CreateSourceBinding>b__15_0 (object,System.EventArgs) [0x0000c] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\MvxFullBinding.cs:85 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxSourceStep.SendSourcePropertyChanged() [0x00006] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxSourceStep.cs:119 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxCombinerSourceStep.SubStepOnChanged (object,System.EventArgs) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxCombinerSourceStep.cs:107 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxSourceStep.SendSourcePropertyChanged() [0x00006] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxSourceStep.cs:119 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxCombinerSourceStep.SubStepOnChanged (object,System.EventArgs) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxCombinerSourceStep.cs:107 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxSourceStep.SendSourcePropertyChanged() [0x00006] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxSourceStep.cs:119 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxCombinerSourceStep.SubStepOnChanged (object,System.EventArgs) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxCombinerSourceStep.cs:107 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxSourceStep.SendSourcePropertyChanged() [0x00006] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxSourceStep.cs:119 
    at MvvmCross.Binding.Bindings.SourceSteps.MvxPathSourceStep.SourceBindingOnChanged (object,System.EventArgs) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\SourceSteps\MvxPathSourceStep.cs:71 
    at MvvmCross.Binding.Bindings.Source.MvxSourceBinding.FireChanged() [0x00006] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\Source\MvxSourceBinding.cs:36 
    at MvvmCross.Binding.Bindings.Source.Leaf.MvxLeafPropertyInfoSourceBinding.OnBoundPropertyChanged() [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\Source\Leaf\MvxLeafPropertyInfoSourceBinding.cs:29 
    at MvvmCross.Binding.Bindings.Source.MvxPropertyInfoSourceBinding.SourcePropertyChanged (object,System.ComponentModel.PropertyChangedEventArgs) [0x00020] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\Source\MvxPropertyInfoSourceBinding.cs:88 
    at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <IL 0x00062, 0xffffffff> 
    at <unknown> <0xffffffff> 
    at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <IL 0x00034, 0xffffffff> 
    at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00038] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:295 
    at System.Reflection.MethodBase.Invoke (object,object[]) [0x00000] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/reflection/methodbase.cs:277 
    at MvvmCross.Platform.WeakSubscription.MvxWeakEventSubscription`2<TKey_REF, TValue_REF>.OnSourceEvent (object,TValue_REF) [0x0000f] in D:\git\MvvmCross\MvvmCross\Platform\Platform\WeakSubscription\MvxWeakEventSubscription.cs:75 
    at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) <IL 0x00074, 0xffffffff> 
    at MvvmCross.Core.ViewModels.MvxNotifyPropertyChanged/<>c__DisplayClass10_0.<RaisePropertyChanged>b__0() <IL 0x0001c, 0x000a7> 
    at MvvmCross.Droid.Views.MvxAndroidMainThreadDispatcher.RequestMainThreadAction (System.Action) <IL 0x0001f, 0x00133> 
    at MvvmCross.Platform.Core.MvxMainThreadDispatchingObject.InvokeOnMainThread (System.Action) [0x00000] in D:\git\MvvmCross\MvvmCross\Platform\Platform\Core\MvxMainThreadDispatchingObject.cs:18 
    at MvvmCross.Core.ViewModels.MvxNotifyPropertyChanged.RaisePropertyChanged (System.ComponentModel.PropertyChangedEventArgs) <IL 0x00044, 0x00277> 
    at MvvmCross.Core.ViewModels.MvxNotifyPropertyChanged.RaisePropertyChanged (string) <IL 0x00009, 0x000b3> 
    at MvvmCross.Core.ViewModels.MvxNotifyPropertyChanged.SetProperty<int> (int&,int,string) <IL 0x00023, 0x00147> 
    at XCPCore.Models.BaseCategory.set_Count (int) [0x00001] in w:\DevWA\MobileXCP~BARONDST\MobileXCP\MobileXcp\MobileXcp.XcpCore\Models\BaseCategory.cs:26 
    at XCPCore.ViewModels.Cal.CalFavoritesViewModel.updateChannels() [0x00075] in w:\DevWA\MobileXCP~BARONDST\MobileXCP\MobileXcp\MobileXcp.XcpCore\ViewModels\Cal\CalFavoritesViewModel.cs:135 
    at XCPCore.ViewModels.Cal.CalFavoritesViewModel.Refresh() [0x00001] in w:\DevWA\MobileXCP~BARONDST\MobileXCP\MobileXcp\MobileXcp.XcpCore\ViewModels\Cal\CalFavoritesViewModel.cs:180 
    at MobileXcp.XcpAndroidApp.Fragments.CalFavoritesFragment.set_UserVisibleHint (bool) [0x0000a] in w:\DevWA\MobileXCP~BARONDST\MobileXCP\MobileXcp\MobileXcp.XcpAndroidApp\Fragments\CalFavoritesFragment.cs:82 
    at Android.Support.V4.App.Fragment.n_SetUserVisibleHint_Z (intptr,intptr,bool) <IL 0x0000b, 0x000b7> 
    at (wrapper dynamic-method) object.7467b8b6-907d-4849-8505-c72161c45779 (intptr,intptr,bool) <IL 0x00017, 0x00043> 
    at (wrapper native-to-managed) object.7467b8b6-907d-4849-8505-c72161c45779 (intptr,intptr,int) <IL 0x0002f, 0xffffffff> 

Attempting native Android stacktrace: 

at ???+3035307817 [0x6fe827f8] 
at ???+3035307817 [0xffffffff] 

================================================================= 
Got a SIGSEGV while executing native code. This usually indicates 
a fatal error in the mono runtime or one of the native libraries 
used by your application. 
================================================================= 

Fatal signal 7 (SIGBUS), code 1, fault addr 0x5 in tid 7646 (leXcp.MobileXcp) 

別のスタックトレースは、起こりました。たぶん何らかの理由で、要素の参照が消去されるか、項目が削除されたときに完全に解放されないことがありますか? このプロセス中に変更されたMvxBindingsがなくても、クラッシュすることはありません。

アップデート2

public abstract class BaseCategory : MvxNotifyPropertyChanged, IChannelItem 
{ 
    public bool Expanded { get; set; } 

    public int FavoriteCount 
    { 
     get { return m_iFavoriteCount; } 
     set { SetProperty(ref m_iFavoriteCount, value); } 
    } 

    public int Count 
    { 
     get 
     { 
      return m_iCount; 
     } 
     set 
     { 
      SetProperty(ref m_iCount, value); 
     } 
    } 
    public string Name { get; set; } 

    protected BaseCategory(string sName) 
    { 
     Expanded = false; 
     Count = 0; 
     FavoriteCount = 0; 
     Name = sName; 
    } 

    private int m_iCount; 
    private int m_iFavoriteCount; 

    public ChannelItemTypes CItemType { get { return ChannelItemTypes.Category; } } 

} 

そして、私のmultititemtemplateselector選択しますレイアウト:アップデート3

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:local="http://schemas.android.com/apk/res-auto" 
       xmlns:cardview="http://schemas.android.com/apk/res-auto" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
    <android.support.v7.widget.CardView 
      android:foreground="?attr/selectableItemBackground" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center" 
    cardview:cardUseCompatPadding="true" 
    cardview:cardCornerRadius="2dp" 
    cardview:cardElevation="2dp" 
    cardview:contentPadding="10dp"> 
    <LinearLayout 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
    <TextView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:gravity="center_vertical" 
     android:layout_gravity="center_horizontal" 
     android:layout_marginRight="5dp" 
     android:padding="10dp" 
     android:textColor="@color/white" 
     android:textStyle="bold" 
     local:MvxBind="Text (Name+' '+Count)" /> 
    </LinearLayout> 
    </android.support.v7.widget.CardView> 
</LinearLayout> 

を明らかにupdateChannels()メソッドは、より多くのデータ・オブジェクトを作成します。 Iamはそれの原因となるものが何であるか分かりません。 LinQコマンドのUI要素へのバインドそれとも私は盲目ですか?

更新4 私は今ちょうどMvxRecyclerViewおよびフラグメントでのObservableCollectionで別々のプロジェクトを作成しました。私がボタンをクリックすると、リストをクリアした後にX個の新しいオブジェクトをリストに追加します。 DeviceMonitorで見ることで、オブジェクトは増加し続けるので、私は何かひどく間違っているか、私が使用するコンポーネントに何か問題があります。

https://github.com/Noires/MvxRecyclerViewLeakTest

更新5 それが問題だったが、それは元の問題に関連していませんでした。ですから、現時点では、私はMVVMCrossを自分自身に変更して、実際の問題を後で確認します。私はコメントで述べたように

更新6 問題はSIGSEGVは主にメモリ管理の問題に接続され、https://github.com/MvvmCross/MvvmCross/issues/1379

+0

私が正しく覚えていれば、 'SIGSEGV'は主にメモリ管理の問題に関連しています。 フラグメントが表示されるたびにこのメソッドが呼び出されますか? – arsena

+0

そうです。 2つのタブの横に、頻繁に更新されるチャートがあり、その背後にあるメソッドはまだ最適化されていません。そのため、GC_Issuesが小さくなることがあります。 – Cyriac

+0

することができます。答えとして解決策を投稿しようとします。 – arsena

答えて

0

現時点での問題は、エントリの参照のみがクリアされない得るため、異なるのviewmodels中のサービスからのエントリのプールを再利用するが、それはそうpropertlyバインディングをクリアするdoesntのことですエントリそのもの。

私のための解決策は、各リストと各エントリについて、余分なバインディングアイテムを追加することです。それが削除されると、私はバインディングが削除されても、GCがそれをきれいにするまでもう使用されないようにします。

もっと良い解決策を望んでいます。詳細情報:

更新:問題(https://github.com/MvvmCross/MvvmCross/issues/1379)が解決しました。ハードワークのためにkjeremyに感謝します!

1

にオープンしました。

RecyclerViewの利点の1つは、リスト全体を更新せずに要素を追加できることです。それは多くのメモリを節約します。

updateChannelsメソッドでは、リスト(おそらくソースはrecyclerView)を消去してから、要素を再度読み込みます。特に大きなリストの場合、これはかなり悪い解決策です。そうすれば、タブを変更するたびにrecyclerViewが更新され、パフォーマンスが著しく低下する可能性があります。

新しいデータがあるかどうかを確認し、新しい要素のみを追加するかどうかを確認する必要があります。

もっと良い例があるかもしれませんが、簡単で高速な解決策はnewList.Except(recyclerViewSourceList)です。これは、リサイクラービューに含まれていない要素を新しいソースから取得します。詳細は チェックこれを:https://stackoverflow.com/a/3944821/3423468

+0

パフォーマンスはかなり向上しましたが、問題を実際に解決するように見えません。問題は、両方のビューモデルで同じカテゴリが参照され、表示されるアイテムの数に応じて「表示」カウントが変更されるという問題があります。通常のビューは6のようで、お気に入りのビューは2のようなので、常に各タブチェンジで前後に移動します。 Atm私はちょうどそれがそれを解決するかどうかを見るためにそれを試してみますが、私は本当にそれを好きではないが、お気に入りのディスプレイカウントのための追加のプロパティを追加することを考えている。 – Cyriac

+0

@Cyriacはプロパティヘルプを追加しましたか? 私は他のことを考えようとします。 – arsena

+0

現時点では、それはそれのように思える、それはまだクラッシュするdidnt。 – Cyriac

関連する問題