You seem to be using an awful lot of code to get a 2x2 grid... I'd take a look at GridLayout.