title: Android - AttributeSet
body: <p>I have a code something like this: </p>
  
  <pre><code>public class CannonView extends SurfaceViewimplements SurfaceHolder.Callback{
  Activity activity;
  </code></pre>
  
  <p>And its constructor:</p>
  
  <pre><code>public CannonView(Context context, AttributeSet attrs){
  Super(context,attrs)
  activity = (Activity) context; 
  </code></pre>
  
  <p>but apparently the AttributeSet is doing nothing, I dont know why is there, so my questions are: 1.-what is AttributeSet? 2.-why do we need to provide AttributeSet attrs as a second argument? by the way the rest of code is for painting using canvas. Thanks.</p>