Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8194881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:57:33+00:00 2026-06-07T04:57:33+00:00

I have created a FileDialog activity in Mono for Android. However, it seems to

  • 0

I have created a FileDialog activity in Mono for Android. However, it seems to me that there is an issue with some MonoObject to JavaObject casting when using ListView simpleadapter.
After I have left onCreate the VM crashes with the following stacktrace:

07-05 15:04:46.493 D/FileDialogActivity( 3430): Left OnCreate
07-05 15:04:46.503 D/AndroidRuntime( 3430): Shutting down VM
07-05 15:04:46.503 W/dalvikvm( 3430): threadid=1: thread exiting with uncaught exception (group=0xb4127180)
07-05 15:04:46.523 D/dalvikvm( 3430): GC_CONCURRENT freed 115K, 3% free 9634K/9863K, paused 0ms+2ms
07-05 15:04:46.523 E/AndroidRuntime( 3430): FATAL EXCEPTION: main
07-05 15:04:46.523 E/AndroidRuntime( 3430): java.lang.ClassCastException: mono.android.runtime.JavaObject cannot be cast to java.util.Map
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.SimpleAdapter.bindView(SimpleAdapter.java:147)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.SimpleAdapter.createViewFromResource(SimpleAdapter.java:126)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.SimpleAdapter.getView(SimpleAdapter.java:114)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.AbsListView.obtainView(AbsListView.java:2033)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.ListView.makeAndAddView(ListView.java:1772)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.ListView.fillDown(ListView.java:672)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.ListView.fillFromTop(ListView.java:732)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.ListView.layoutChildren(ListView.java:1625)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.AbsListView.onLayout(AbsListView.java:1863)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.RelativeLayout.onLayout(RelativeLayout.java:925)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.View.layout(View.java:11278)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewGroup.layout(ViewGroup.java:4224)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1489)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.os.Looper.loop(Looper.java:137)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at android.app.ActivityThread.main(ActivityThread.java:4424)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at java.lang.reflect.Method.invokeNative(Native Method)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at java.lang.reflect.Method.invoke(Method.java:511)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-05 15:04:46.523 E/AndroidRuntime( 3430):     at dalvik.system.NativeStart.main(Native Method)

Some Code:

IList<IDictionary<string, object>> mData = new List<IDictionary<string, object>>();
AddFiles(files, mData); // Which just new Dictionary with filedata and icon from a list of files.
SimpleAdapter fileAdapter = new SimpleAdapter(this, mData,
            Resource.Layout.FileDialogRow,
            new string[] { FileKey, FileImage },
            new int[] { Resource.Id.fdrowname, Resource.Id.fdrowimage }
        );
ListAdapter = fileAdapter;
Log.Debug("Left OnCreate");

Anyone else have an issue when using SimpleAdapter on Mono for Android? Or have any clues to what happens here??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:57:34+00:00Added an answer on June 7, 2026 at 4:57 am

    Instead of using List I think you will need to use JavaList. Like:

    var mData = new JavaList<IDictionary<string, object>>();
    

    There is a long explanation it this thread: http://mono-for-android.1047100.n5.nabble.com/SimpleAdapter-break-in-4-2-1-td5709793.html

    I you are going to use more complex things in your list I suggest implementing your own Adapter, which is a lot easier to maintain and debug in the end.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created some JQuery that will expand a div 'popup' on hover and
I have created an android application that calls (using kSOAP library) a SOAP based
I have created an object called Project that has different properties (strings and some
I have created a function that shows/hides different messages according to a combination of
I have created a dialog and got a problem that only part of the
After reading some posts like this one: Choose File Dialog It appears that Android
Have created simple Ajax enabled contact forms before that have around 12 fields -
Have created an attribute property in TableView1.h and pushing that attributes value to another
I have created custom listview in that have list of textview & list of
I have created a triangle using canvas but i was wondering if there was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.