Layouts are a "ViewGroup" and all other views are a "View", buttons and stuff are a "Widget". Someone plz correct me if I'm wrond here.
Concerning your code:
Your code works exactly like you've written it.
You've created a custom layout called "BitBucket", it is a completely empty RelativeLayout.
In the first XML you use your BitBucket layout as a parent Viewgroup to your buttons
and in your main.XML you use your BitBucket layout as a "component" in a normal LinearLayout.
Do you see what went wrong? You've used BitBucket twice, but these two files have nothing to do with one another.
So it makes sense that your code displays an empty screen, thats because you've included an emtpy BitBucket-layout.
- Get a handle to the LinearLayout in main.xml in your activity (with FindViewById()).
- Use the LayoutInflator to inflate the first xml file (BitBucket with buttons)
- Call .addView on your handle
Using java Syntax Highlighting
LinearLayout parent = (LinearLayout)FindViewById(R.id.yourLinearLayout);
LayoutInflater inflater = getLayoutInflater();
myView = inflater.inflate(R.layout.yourXML, null);
Parsed in 0.036 seconds, using GeSHi
that should work, but it could be something different than what you want to achieve.
You could also try to edit your BitBucket-class definition to include the buttons. I haven't tried that before but it should work in theory, could be interesting to give it a try, if you succeed plz let me know