java - How to Call the class that extends RelativeLayout programatically in android? -
i've made layout in java class extending relativelayout
, want call view programatically when button clicked. able set custom layout in xml file this
<com.sample.customlayout android:layout_width="wrap_content" android:layout_height="wrap_content"/>
i have set sample of code below
public class card extends relativelayout { textview tutorialok; public card(context context) { super(context); init(); } public card(context context, attributeset attrs) { super(context, attrs); init(); } public card(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); init(); } }
how call class when button clicked ? since, i'm new android, tips or code helpful !
//custom layout called qualified name ... package.classname <com.sample.card android:layout_width="wrap_content" android:layout_height="wrap_content"/>
Comments
Post a Comment