Please see the reply I made a couple hours ago to the same thing you
posted in android-beginners.
http://groups.google.com/group/android-beginners/browse_thread/thread/f25bb151ca62bb1/708bd4b8ab765737

R/

On Sat, May 2, 2009 at 11:53 AM, Mariam Rady <mariam.r...@gmail.com> wrote:
>
> Hi everyone,
> I'm trying to add an OnClickListener and an OnTouchListener on a
> button. However when I add the OnClickListener on the button it
> works.
> Whenever I add the OnTouchListener to the button with the
> OnCLickListener, none of them works. Here is the code:
>
>                        final Button a=new Button(this);
>                        a.setLayoutParams(new
> AbsoluteLayout.LayoutParams
> (-2,-2,lastxposition,lastyposition));
>                        a.setText("Button");
>
>
>                        a.setOnClickListener(new View.OnClickListener
> ()
>                        {
>                               �...@override
>                        public void onClick(View v) {
>                                                          openFiles
> ();
>                                        }
>
>
>                        });
>
>
>                        a.setOnTouchListener(new View.OnTouchListener
> ()
>                                 {
>                       �...@override
>                        public boolean onTouch(View v, MotionEvent
> event) {
>                        String tagname=(String) a.getText();
>                        findID(tagname);
>                        return true;
>                                        }
>
>
>                                });
>
>
> Can anybody tell me what I do wrong here?
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to