The culprit was this line: > MarginLayoutParams params = new ViewGroup.MarginLayoutParams(50, 50);
since my parent is RelativeLayout, it should like this: RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(50, 50); and it all works now. Thanks guys. Regards, Marcin Orlowski *Tray Agenda <http://bit.ly/trayagenda>* - keep you daily schedule handy... *Date In Tray* <http://bit.ly/dateintraypro> - current date at glance... WebnetMobile on *Facebook <http://webnetmobile.com/fb/>*, *Google+*<http://bit.ly/webnetmobile-gp>and *Twitter <http://webnetmobile.com/twitter/>* -- 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

