Android Change Include Layout Programmatically Code Example


Example 1: code to include layout from java in android

<ViewStub     android:id="@+id/layout_stub"     android:inflatedId="@+id/message_layout"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:layout_weight="0.75" />

Example 2: code to include layout from java in android

ViewStub stub = (ViewStub) findViewById(R.id.layout_stub); stub.setLayoutResource(R.layout.whatever_layout_you_want); View inflated = stub.inflate();

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable