I am currently implementing a crossplatform-app for Android and iOS.
Since I want to use MvvmCross and a flyout-navigation, if found Benjamin Hysell's demo (using a DrawerLayout) extremely helpful:
Code: https://github.com/benhysell/V.FlyoutTest
Description: http://benjaminhysell.com/archive/2014/04/mvvmcross-flyoutnavigation-hamburger-menu-sliding-menu-for-android-and-ios/
Based on this code, I wanted to add some additional controls underneath the menu inside the flyout navigation.
So in HomeView, I added the following code at the end of method
protected override void OnCreate(Bundle savedInstanceState)
{
// ....
var layout = this.BindingInflate(Resource.Layout.DrawerFooterView, null);
drawerList.AddFooterView(layout);
}
Now, when I start the app, i can see everthing just fine, including my extra controls in the flyout menu. But as soon i tap a menu item, I get a NullReferenceException in MvvmCross:
04-25 17:42:20.892 I/MonoDroid(32443): UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
04-25 17:42:20.892 I/MonoDroid(32443): at Cirrious.MvvmCross.Binding.Droid.Views.MvxListView.ExecuteCommandOnItem (System.Windows.Input.ICommand,int) <IL 0x0000b, 0x000a0>
04-25 17:42:20.892 I/MonoDroid(32443): at Cirrious.MvvmCross.Binding.Droid.Views.MvxListView.<EnsureItemClickOverloaded>b__0 (object,Android.Widget.AdapterView/ItemClickEventArgs) <IL 0x0000d, 0x000a7>
04-25 17:42:20.892 I/MonoDroid(32443): at Android.Widget.AdapterView/IOnItemClickListenerImplementor.OnItemClick (Android.Widget.AdapterView,Android.Views.View,int,long) [0x0000d] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/a1e3982a/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Widget.AdapterView.cs:261
04-25 17:42:20.892 I/MonoDroid(32443): at (wrapper dynamic-method) object.289e379c-ed35-42d0-8505-cc91a6c90d7b (intptr,intptr,intptr,intptr,int,long) <IL 0x00029, 0x0009b>
Can anyone provide assistance to this issue, because I am out of ideas.
Any help would be appreciated.