title: findViewById() in extends subclass
body: <p>I have two classes like:</p>
  
  <pre><code>public class Game extends Activity
  
  public class CoreGame extends Game
  </code></pre>
  
  <p>In <strong>CoreGame</strong> class I have:</p>
  
  <pre><code>public void init(){
      layout = (RelativeLayout)findViewById(R.id.rlayout);
  }
  </code></pre>
  
  <p>The execution return <code>NullPointerException</code> at <code>layout = (RelativeLayout)findViewById(R.id.rlayout);</code> <strong>CoreGame</strong> class line.</p>
  
  <p>Why? </p>
  
  <p>The OnCreate :</p>
  
  <pre><code>   @Override
      public void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
  
          requestWindowFeature(Window.FEATURE_NO_TITLE);
          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
  
          setContentView(R.layout.game);
  
          core = new CoreGame(this);
          core.runCoreGame();
  
      }
  </code></pre>
  
  <p>The Core.runCoreGame():</p>
  
  <pre><code>public void runCoreGame(){
      init();
  }
  
  public void init(){
      layout = (RelativeLayout)findViewById(R.id.rlayout);
  }
  </code></pre>
  
  <p>The StackTrace:</p>
  
  <pre><code>FATAL EXCEPTION: main
      java.lang.RuntimeException: Unable to start activity ComponentInfo{gianbalex.mgs_revenge/gianbalex.mgs_revenge.Game}: java.lang.NullPointerException
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
          at android.app.ActivityThread.access$2300(ActivityThread.java:125)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:123)
          at android.app.ActivityThread.main(ActivityThread.java:4627)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:521)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
          at dalvik.system.NativeStart.main(Native Method)
      Caused by: java.lang.NullPointerException
          at android.app.Activity.findViewById(Activity.java:1637)
          at gianbalex.mgs_revenge.CoreGame.initVariables(CoreGame.java:118)
          at gianbalex.mgs_revenge.CoreGame.runCoreGame(CoreGame.java:84)
          at gianbalex.mgs_revenge.Game.onCreate(Game.java:28)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
  </code></pre>