What about something like this:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* Adding the icon and text */
// Creating a new RelativeLayout
final RelativeLayout relativeLayout = new RelativeLayout(this);
// Defining the RelativeLayout layout parameters.
// In this case I want to fill its parent
final RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT
);
rlp.addRule(RelativeLayout.CENTER_IN_PARENT);
final TextView view = new TextView(this);
view.setText("Add");
view.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.add_16, 0, 0);
view.setGravity(Gravity.CENTER);
relativeLayout.addView(view, rlp);
setContentView(relativeLayout);
}