Creation of New Thread is Giving an error
<p>I am new to android i am trying to create a new thread to invoke another method.
But don't why it is throwing the error.</p>

<p>here is my stub</p>

<pre><code>void test()

    {

        int i=0;
        Toast.makeText(getApplicationContext(), "Testing", Toast.LENGTH_SHORT).show();

    }
    public void Button2_Click(View v)
    {
        Thread thread = new Thread()
        {
              @Override
              public void run() {
                  test();
              }
          };

        thread.start();
    }
</code></pre>
