title: android.app.Application cannot be cast to android.app.Activity
body: <p>I'm trying to change a <code>LinearLayout</code> from another class, but when i run this code:</p>
  
  <pre><code>public class IRC extends PircBot {
  
  ArrayList&lt;String&gt; channels;
  ArrayList&lt;Integer&gt; userCount;
  ArrayList&lt;String&gt; topics;
  
  LinearLayout channelLayout;
  Context context;
  
  public IRC(Context ctx) {
      this.setName("xxxx");
      channels = new ArrayList&lt;String&gt;();
      userCount = new ArrayList&lt;Integer&gt;();
      topics = new ArrayList&lt;String&gt;();
  
      context = ctx;
  
      channelLayout = (LinearLayout) ((Activity) context).findViewById(R.id.channels);
  }
  </code></pre>
  
  <p>i get a <code>ClassCastException</code></p>
  
  <p>context is the Main activity that extends <code>Activity</code> passed with a getApplicationContext();</p>
  
  <p><strong>LOGCAT</strong></p>
  
  <pre><code>05-08 17:53:55.102    3736-3799/g.d.allinonechat E/AndroidRuntime﹕ FATAL EXCEPTION: Thread-5357
  java.lang.ClassCastException: android.app.Application cannot be cast to android.app.Activity
          at g.d.xxx.IRC.&lt;init&gt;(IRC.java:34)
          at g.d.xxx.MainActivity$1.run(MainActivity.java:49)
          at java.lang.Thread.run(Thread.java:856)
  </code></pre>