Dynamicly adding views into a specific fragment layout
===

Hi i am trying to add a TextView dynamicly into a layout which is part of a Fragment.
But it is not working. As soon as the application starts it shuts down immediatly.
I think it has to do something with the
"TextView Paper = new TextView(**this**);" part. I dont know how to get the right **Context** since im working with Fragments. Maybe my assumption is wrong but i really dont know where the error might be.

    public class PageFragment extends Fragment {
    
    	private int fragmentNR;
    
    	public PageFragment(int nr) {
    		this.fragmentNR = nr;
    	}
    
    	@Override
    	public View onCreateView(LayoutInflater inflater, ViewGroup container,
    			Bundle savedInstanceState) {
    		View v = new View(getActivity());
    		if (fragmentNR == 0)
    			v = inflater.inflate(R.layout.page1, container, false);
    		else if (fragmentNR == 1)
    			v = inflater.inflate(R.layout.page2, container, false);
    		else if (fragmentNR == 2)
    			v = inflater.inflate(R.layout.page3, container, false);
    
    		return v;
    	}
    
    }

>     public class MainActivity extends FragmentActivity  {
>     
>         @Override
>         public void onCreate(Bundle savedInstanceState) {
>         	super.onCreate(savedInstanceState);
>     		setContentView(R.layout.main);
>     
>     		PageAdapter mPageAdapter = new PageAdapter(getSupportFragmentManager());
>     		ViewPager mViewPager = (ViewPager) findViewById(R.id.viewpager);
>     		mViewPager.setAdapter(mPageAdapter);
>     		
>     	    //This is where i try to add my TextView into my Layout
>           LinearLayout PaperLayout = (LinearLayout) findViewById(R.id.PaperLayout);//PaperLayout is a LinearLayout within the Page2-Fragment(R.layout.page2)
>     	    TextView Paper = new TextView(this);
>     	    Paper.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
>     	    Paper.setText("Paper2");
>     	    PaperLayout.addView(Paper);
>         }        
>     }