Re: [android-beginners] onClickListener of a view

2010-03-23 Thread Luca Bedogni
Doesn't work, I have the view that now is 30x30 pixels, but on the top left of the screen and my drawable gets cutted off. -- Luca Bedogni Freelance Web Developer http://www.lucabedogni.it On Tue, Mar 23, 2010 at 3:11 AM, murali raju manutd...@gmail.com wrote: use h.setLayoutParams(new

Re: [android-beginners] onClickListener of a view

2010-03-22 Thread Luca Bedogni
Mmm, I investigated a bit and i think this is not the problem. I'm making a new object every time. Beside that, I noticed that the view added has the dimensions of the screen, and not 30 pixels as I want. How can I avoid that? Thanks -- Luca Bedogni Freelance Web Developer

Re: [android-beginners] onClickListener of a view

2010-03-22 Thread murali raju
use h.setLayoutParams(new ViewGroup.LayoutParams( 30,30)); On Mon, Mar 22, 2010 at 11:49 AM, Luca Bedogni bedogni.l...@gmail.comwrote: Mmm, I investigated a bit and i think this is not the problem. I'm making a new object every time. Beside that, I noticed that the view

Re: [android-beginners] onClickListener of a view

2010-03-21 Thread murali raju
coz you are using the same view object to all the shapes. so only the most recently created view will have listener. use an arraylist and add the view to it when ever a shape is created. and check which view is clicked by using view.isPressed(). On Sun, Mar 21, 2010 at 1:26 AM, Luca Bedogni

[android-beginners] onClickListener of a view

2010-03-20 Thread Luca Bedogni
Hi I have the following code: int x = (int)Math.round(Math.random()*200); int y = (int)Math.round(Math.random()*300); View h = new CustomDrawableView(c,x,y); h.setLayoutParams(new ViewGroup.LayoutParams(