code to include layout from java in android

Solutions on MaxInterview for code to include layout from java in android by the best coders in the world

showing results for - "code to include layout from java in android"
Victoria
25 Oct 2016
1<ViewStub
2    android:id="@+id/layout_stub"
3    android:inflatedId="@+id/message_layout"
4    android:layout_width="match_parent"
5    android:layout_height="match_parent"
6    android:layout_weight="0.75" />
Danika
27 Jan 2020
1ViewStub stub = (ViewStub) findViewById(R.id.layout_stub);
2stub.setLayoutResource(R.layout.whatever_layout_you_want);
3View inflated = stub.inflate();