Created
June 26, 2015 19:25
-
-
Save slezica/eeb7924745573a2ca2ee to your computer and use it in GitHub Desktop.
Loading XML in custom Android View
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package view; | |
public class CustomComplexView extends FrameLayout { | |
public CustomComplexView(Context context) { | |
super(context); | |
init(); | |
} | |
public CustomComplexView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
init(); | |
} | |
public CustomComplexView(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
init(); | |
} | |
void init() { | |
addView(inflate(getContext(), R.layout.complex_view_layout, null)); | |
// mSubView1 = findViewById(R.id.foo); | |
// mSubView2 = findViewById(R.id.bar); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment