title: how to give id for Button By Dynamic Creations in Android?
body: <p>I am trying to create a button by Dynamically and also i created .Now i want to write the function for click Event So i need the id for Button.I Dont know How to Create id for button Dynamically.Guide me
  Thanks in Advance
  Here My coding</p>
  
  <pre><code>        ScrollView sv = new ScrollView(this);
          LinearLayout ll = new LinearLayout(this);
          ll.setOrientation(LinearLayout.HORIZONTAL);
          sv.addView(ll);
          Button main=new Button(this);
          CharSequence value="Main +";
          main.setText(value);
          ll.addView(main);
             }
          this.setContentView(sv);
      }
  </code></pre>