created new class in android but can't figure out context
<p>I created a new class in android that creates LinearLayouts when instantiated. However I can't figure out the context to put in the brackets of: <code>new LinearLayout(context)</code>. Can someone shed some light? (I've already tried reading everything i can on contexts)</p>

<p>I'm assuming I don't need to extend Activity in my class</p>

<pre><code>public class NewLayouts {
...
newParentLayout = new LinearLayout(getApplicationContext()); //&lt;--eclipse warns of error here saying not a valid context
newParentLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
newParentLayout.setOrientation(LinearLayout.VERTICAL);
TextView monthDisplay = new TextView(getApplicationContext()); //&lt;--eclipse warns of error here saying not a valid context
...
}
</code></pre>

<p>My main activity:</p>

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

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        NewLayouts Sample = new NewLayouts(1,2); //variables required in my constructor for new Layouts
        setContentView(Sample.newParentLayout);
}
</code></pre>
