Button not getting displayed after parsing the XML
<p>I have an XML parser which is derived from Activity class and it parses a Button from XML.
If i create Button using Android Button API it is getting displayed on the activity. But when i create my own class for taking button attributes and display button from that class it is not getting displayed. This own class which i am creating extends LinearLayout and is unable to display.</p>

<p>I am calling the constructor of GuiButton class with required parameters.
Please find the code below.</p>

<pre><code>public class GuiButton extends LinearLayout{

String label;   
int type;   
public String reqType;  
public String context;  
/**
 *  Network message for this button
 */
public String netMsg;       
/**
 * network image id for this button
 */
public String networkImageID;   
public String id;

Button btn;


public GuiButton(Context cntxt,String label,int type,String requestType,String netImgID, String id,String context,int priority,int commandType) {
    super(cntxt);



    this.setOrientation(VERTICAL);        
    btn = new Button(cntxt);
    btn.setText(label);
    addView(btn,new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));            
}
</code></pre>

<p>What should i do in order to display this button on Activity? Please help me in solving this problem.</p>
