title: XML Parser Android - Calling New Activity
body: <p>I have a question about xml parser in android. I am creating button information in the xml. I am getting its height,width,color and so on. I am creating all buttons in a function. Now i want to do the following. When i click the buttons, new android page opens. As far as i know i will do it by creating new activities. </p>
  
  <pre><code>btn.setOnClickListener(new View.OnClickListener() { 
                  public void onClick(View v) {
                        Intent i=new Intent(MainActivity.this,MainActivity2.class);
                        startActivity(i);
  
                  }
              });
  </code></pre>
  
  <p>I am writing this on my function which i create all buttons.when i do this it does not work.can somebody help me?  </p>