[mono-android] ClassNotFoundException with ItemClick event
Jonathan Pryor
jpryor at novell.com
Fri Mar 25 09:27:12 EDT 2011
On Mar 25, 2011, at 5:27 AM, Faze Faze wrote:
> I'm new to monodroid (and new to android dev) and I'm facing a problem when binding the ItemClick event.
...
>
> protected override void OnCreate(Bundle bundle)
> {
...
> //Wire up the click event
try {
> listView.ItemClick += new EventHandler<ItemEventArgs>(showToast);
} catch (Java.Lang.Throwable e) {
Android.Util.Log.Error("no!", e, "this is the java-side exception.");
}
> Do you have any idea on where the problem is ?
No, because we don't know what the Java-side message and stack trace are. (Fortunately, the next release will -- finally! -- include the Java side exception information when you call Java.Lang.Throwable.ToString()...)
The above code wraps the call in a try/catch block, then uses Log.Error() to print the error message on the Android error log. You can then use `adb logcat` to view the Java-side exception message, which will either provide you enough information to figure out what's wrong, or provide us enough information to investigate further. :-)
- Jon
More information about the Monodroid
mailing list