Re: [android-developers] Re: Game develop like "Air Attack" touching screen event

2010-04-19 Thread a a
It still can't work. It says "Set whether this view can receive focus while in touch mode. Setting this to true will also ensure that this view is focusable." I think my view is not "in touch mode", so how to set my view with touch mode? is it right? 2010/4/19 Robert Green : > No, > > Don't ov

[android-developers] Re: Game develop like "Air Attack" touching screen event

2010-04-19 Thread Robert Green
No, Don't override it in your view. Call it from your view in the constructor. setFocusableInTouchMode(true) is what you want to call. On Apr 19, 1:40 am, a a wrote: > I add > >                 android:focusableInTouchMode="true" > in my xml > > and try to override the > >         @Override >

Re: [android-developers] Re: Game develop like "Air Attack" touching screen event

2010-04-18 Thread a a
I add android:focusableInTouchMode="true" in my xml and try to override the @Override public void setFocusableInTouchMode(boolean focusableInTouchMode) { Log.d("harvey", "setFocusableInTouchMode"); } But still can work when

Re: [android-developers] Re: Game develop like "Air Attack" touching screen event

2010-04-18 Thread a a
Dear Robert, How can i calls setFocusableOnTouchEvents(true)? where can i wrote? 2010/4/17 Robert Green : > Make sure your view calls setFocusableOnTouchEvents(true) > > On Apr 16, 4:44 am, a a wrote: >> Dear all, i tested below, but it don't work >> >> 1. I wrote my GodsendView >> public class

[android-developers] Re: Game develop like "Air Attack" touching screen event

2010-04-16 Thread Robert Green
Make sure your view calls setFocusableOnTouchEvents(true) On Apr 16, 4:44 am, a a wrote: > Dear all, i tested below, but it don't work > > 1. I wrote my GodsendView > public class GodsendView extends View implements OnTouchListener > { >         @Override >         public boolean onTouch(View v,

[android-developers] Re: Game develop like "Air Attack" touching screen event

2010-04-16 Thread a a
Dear all, i tested below, but it don't work 1. I wrote my GodsendView public class GodsendView extends View implements OnTouchListener { @Override public boolean onTouch(View v, MotionEvent event) { Log.d("harvey", "onTouch"); return false; }