i have a relative layout and i have two buttons in it with texts \"hello\" and \"world\" respectively. i want these two buttons to lie adjacent to each other and equally occupy
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int height = metrics.heightPixels;
int width = metrics.widthPixels;
in relative layout you can achieve this dynamically.