Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

ListView in TableView: Unable to activate instance of type ...ListViewAdapter from native handle

$
0
0

In my shared code project application I'm using something similar to this:

List<string> data = new List<string> { "1", "2", "3", "4", "5", "6", "7" };
ListView lv = new ListView()
{
    BackgroundColor = Color.Silver
    ,ItemsSource = data
    ,RowHeight = ScreenHeight / 6
};
MainPage = new ContentPage
{
    Content = new TableView()
    {
        BackgroundColor = Color.White,
        RowHeight = ScreenHeight / 3,
        Root = new TableRoot("") 
        {
            new TableSection("")
            {
                new ViewCell(){View =lv}
                ,new ViewCell(){View =lv}
                ,new ViewCell(){View =lv}
                ,new ViewCell(){View =lv}
                ,new ViewCell(){View =lv}
                ,new ViewCell(){View =lv}
                ,new ViewCell(){View =lv}
                ,new ViewCell(){View =lv}
                ,new ViewCell(){View =lv}
                ,new ViewCell(){View =lv}
            }
        }
    }
};

It's all fun and games until I try to scroll on any kind of android emulator or device: then sometimes I get nasty exceptions that starts with:
"System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.ListViewAdapter from native handle 3b900039 ---> System.MissingMethodException: No constructor found for Xamarin.Forms.Platform.Android.ListViewAdapter::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown."
If anyone is interested I added all exception text as .txt file.

The question here is: Do I do anything wrong here? And how to cure it?

Working environment:
Visual Studio 2013
Xamarin 3.11.836.0
Xamarin.Android 5.1.5.3
Xamarin.iOS 8.10.4.0
Xamarin.Forms.Core shows version 1.4.0.0


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>