android view and textview confusion in inflating and returning
<pre><code>package com.test1;

import android.app.Activity;
import android.app.ExpandableListActivity;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;

public class Test1Activity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        c1 c1obj = new c1();
        setContentView(c1obj.m1());
    }

    public class c1  
    {
        public View m1()
        {
            LayoutInflater i = (LayoutInflater) Test1Activity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

            View v = i.inflate(R.layout.main, null);

            TextView tv = (TextView) v.findViewById(R.id.textView1);

            tv.setText("Hello world !!!");

            return v;
        }
    }
}
</code></pre>

<p>if i try to return textview(tv) it gives me runtime error if i return view(v) it works fine can anyone tell me why is that.</p>
