Hi,
Could anyone tell me what I'm doing wrong here?
> using System;using Android.App;using Android.Content;using
> Android.Runtime;using Android.Views;using Android.Widget;using
> Android.OS;using Android.Text;using Android.Views;using
> Android.Views.KeyEvent;using Android.Widget.EditText;using
> Android.App.Activity;using Android.OS.Bundle;using Android.Text.Util;using
> Android.Views.InputMethods.InputMethodManager;
> namespace SiteZoeker
> {
> [Activity(Label = "SiteZoeker", MainLauncher = true, Icon =
> "@drawable/icon")]
> public class Activity1 : Activity
> {
> EditText mEdit;
>
> protected override void OnCreate(Bundle bundle)
> {
> base.OnCreate(bundle);
>
> // Set our view from the "main" layout resource
> SetContentView(Resource.Layout.Main);
>
> mEdit=(EditText)FindViewById(Resource.Id.txtSitenummer);
>
> mEdit.SetOnKeyListener(EnterHit);
>
> }
>
> private View.SetOnKeyListener Enterhit = new View.SetOnKeyListener
> {
> public Boolean onKey(View v, int keyCode, KeyEvent Event)
> {
> if ((Event.KeyCode == Keycode.Enter))
> {
> mEdit.RequestFocus();
> return true;
> } else
> return false;
> }
> };
> }}
>
>
>
The red parts are the ones giving me the error:
Error 3 Type or namespace definition, or end-of-file expected
Error 4 The name 'EnterHit' does not exist in the current context
Error 5
'Android.Views.View.SetOnKeyListener(Android.Views.View.IOnKeyListener)'
is a 'method' but is used like a 'type'
Error 7 Invalid initializer member declarator
Error 2 } expected
Error 1 ; expected
Error 6
'Android.Views.View.SetOnKeyListener(Android.Views.View.IOnKeyListener)'
is a 'method' but is used like a 'type'
I use Visual Studio 2010 SP1 with Monodroid Eval installed.
br,
Eric
>
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en