I have a custom view which will be jar'ed up and added into another project. In the view I want to give an option of a button. 

Here is what I have in the CustomView class. 

```
final CustomView currentView = (CustomView) findViewById(this.getId());

RelativeLayout.LayoutParams params = (new   RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT ));

params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
closeButton.setLayoutParams(params);

currentView.addView(closeButton);

```

This is all wrapped in a RelativeLayout Tag as well as the other objects of the application

Everything compiles however in the CustomView the Button is aligning left instead of right.Any Ideas???