Accessing my method in different class
<p>I have created one class as  </p>

<pre><code>public class FormActivity extends Activity 
{
    TextView tv =new TextView(this);
    GridLayout gl=new GridLayout(this);

    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        paint();
    }

    public void paint()
    {
        tv.setText("In new File");
        gl=(GridLayout) findViewById(R.id.gl);
        gl.addView(tv);
    }
}
</code></pre>

<p>and I want to access the <code>paint()</code> method from a different class (java file in same package).
I have tried this:</p>

<pre><code>public class FileSystemDemoActivity extends Activity 
{

    FormActivity f1=new FormActivity();
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        f1.paint();
    }
}
</code></pre>

<p>But this doesn't work. The emulator gives unfortunately stopped error. Please help me.</p>
