menu.addView(text[i], itemParam);
final View v = text[i];
ViewTreeObserver vto = v.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@SuppressWarnings("deprecation")
@Override
public void onGlobalLayout() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
v.getViewTreeObserver().removeGlobalOnLayoutListener(this);
else
v.getViewTreeObserver().removeOnGlobalLayoutListener(this);
int x0 = v.getLeft(),
y0 =v.getTop(),
x1 = v.getRight(),
y1 = v.getBottom();
System.out.println("Создали элемент с координатами: [" + x0 + "," + y0 + "]-[" + x1 + "," + y1 + "]");
}
});