I am creating a button dynamically for a particular screen. It is clearly visible in Emulator where as looking very small in Device (Nexus 5).
In Emulator:
In Device:
I am using below code for button creation in code:
LayoutParams updt_btn_params = new LayoutParams();
update_data = new Button(this);
update_data.setText("Update");
update_data.setTextSize(9);
updt_btn_params.width=80;
updt_btn_params.height=45;
updt_btn_params.gravity=Gravity.CENTER_HORIZONTAL;
update_data.setOnClickListener(update_listnr);
update_data.setLayoutParams(updt_btn_params);
What else I have to do for getting buttons clearly in Device. TIA