You need one or both of these in your ExtendedDatePicker constructor:

                setFocusable(true);
                setFocusableInTouchMode(true);

On Mar 29, 5:13 am, Rhett <[EMAIL PROTECTED]> wrote:
> I am having similar problems.
>
> This doesn't work for me:
>
> public class ExtendedDatePicker extends DatePicker {
>
>     public ExtendedDatePicker(Context arg0, AttributeSet arg1, Map
> arg2) {
>
>         super(arg0, arg1, arg2);
>
>         this.setOnKeyListener(new OnKeyListener() {
>             public boolean onKey(View v, int arg1, KeyEvent event) {
>                 Log.d("DEBUGTAG", event.toString());
>                 return true;
>             }
>         });
>
> }}
>
> On Mar 3, 8:38 pm, john spurling <[EMAIL PROTECTED]> wrote:
>
> > I've not been able to successfully use the View.OnKeyListener
> > interface: it never seems to get called. I'm using it like so (inside
> > of my Activity):
>
> >         View myview = findViewById(R.id.myview);
> >         myview.setOnKeyListener(new View.OnKeyListener() {
> >                 public boolean onKey(View v, int keyCode, KeyEvent event) {
> >                     Log.i(TAG, "entering OnKeyListener.onKey...");
> >                     return true;
> >                 }
> >             });
>
> > Interestingly, OnClickListener works just fine when used the same way.
> > I'm able to grab the key events in Activity.onKeyDown, but I'm curious
> > why this approach isn't working. I would just assume that I was doing
> > something wrong (still a distinct possibility), but Twisty (the Z-
> > Machine project) uses this code, and it doesn't work there for me
> > either.
>
> > Thanks,
> > john spurling
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to