[Monodroid] View onClick attribute support

Mike Kestner mkestner at novell.com
Tue Mar 1 09:51:52 EST 2011


Thanks for filing the bug.  I would categorize this more in the
"unsupported feature" realm.  Supporting it will require a significant
amount of work to scan for these attributes and set up forwarding
infrastructure so that java/dalvik can locate the methods.  

Based on the fact that events make it trivial to do these connections in
C# code, I would consider it a pretty low-priority feature.  I'd
personally rather invest effort into our own UI designer post-1.0 than
try to support stuff like this.  Especially considering that only
onClick seems to be supported "event" by android layouts.

Mike


On Mon, 2011-02-28 at 23:14 -0600, Jonathan Pobst wrote:
> If you have linking on, try turning that off and see if that helps.
> 
> If it still doesn't work, it sounds like a bug.  Please file a bug with 
> a test case so we can fix it.
> 
> Thanks!
> 
> Jonathan
> 
> On 2/28/2011 10:46 PM, Adam Tybor wrote:
> > Does MonoDroid support the android:onClick attribute for views?  Running
> > a test in preview 13 yields me this stack trace
> >
> > E/AndroidRuntime(  480): java.lang.IllegalStateException: Could not find
> > a method Login_OnClick(View) in the activity class android.LoginActivity
> > for onClick handler on view class android.widget.Button with id 'Login'
> > E/AndroidRuntime(  480):        at
> > android.view.View$1.onClick(View.java:2131)
> > E/AndroidRuntime(  480):        at
> > android.view.View.performClick(View.java:2485)
> > E/AndroidRuntime(  480):        at
> > android.view.View$PerformClick.run(View.java:9080)
> > E/AndroidRuntime(  480):        at
> > android.os.Handler.handleCallback(Handler.java:587)
> > E/AndroidRuntime(  480):        at
> > android.os.Handler.dispatchMessage(Handler.java:92)
> > E/AndroidRuntime(  480):        at android.os.Looper.loop(Looper.java:123)
> > E/AndroidRuntime(  480):        at
> > android.app.ActivityThread.main(ActivityThread.java:3647)
> > E/AndroidRuntime(  480):        at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > E/AndroidRuntime(  480):        at
> > java.lang.reflect.Method.invoke(Method.java:507)
> > E/AndroidRuntime(  480):        at
> > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
> > E/AndroidRuntime(  480):        at
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
> > E/AndroidRuntime(  480):        at dalvik.system.NativeStart.main(Native
> > Method)
> > E/AndroidRuntime(  480): Caused by: java.lang.NoSuchMethodException:
> > Login_OnClick
> > E/AndroidRuntime(  480):        at
> > java.lang.ClassCache.findMethodByName(ClassCache.java:247)
> > E/AndroidRuntime(  480):        at java.lang.Class.getMethod(Class.java:962)
> > E/AndroidRuntime(  480):        at
> > android.view.View$1.onClick(View.java:2124)
> > E/AndroidRuntime(  480):        ... 11 more
> > W/ActivityManager(   63):   Force finishing activity
> > Android/android.LoginActivity
> >
> > Adam
> >
> >
> >
> > _______________________________________________
> > Monodroid mailing list
> > Monodroid at lists.ximian.com
> >
> > UNSUBSCRIBE INFORMATION:
> > http://lists.ximian.com/mailman/listinfo/monodroid
> 
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
> 
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid




More information about the Monodroid mailing list