I have created an own View:
private class SampleView extends View {
and I want to “plant” this View into a LinearLayout which I created in an xml file.
How do I do that? Can someone help me?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try to add your custom
Viewlike this:Your custom
Viewclass must bepublicandstaticfor the above code to work.Another option is to put the
SampleViewin its own file and simply use the code from the answers above.