title: Fatal error exception in android
body: <p>I'm trying to write android diet planner. after I debug it I find when my first page fade out and activity want to go to the second page then fatal error exception occurs but I cant find where is the problem? can any one help me ?</p>
  
  <p>ERRORS </p>
  
  <pre><code>10-24 06:35:46.622: E/AndroidRuntime(1102): FATAL EXCEPTION: main
  10-24 06:35:46.622: E/AndroidRuntime(1102): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dietplanneraplication/com.example.dietplanneraplication.FeatureList}: java.lang.NullPointerException
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at android.os.Handler.dispatchMessage(Handler.java:99)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at android.os.Looper.loop(Looper.java:137)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at android.app.ActivityThread.main(ActivityThread.java:4745)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at java.lang.reflect.Method.invokeNative(Native Method)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at java.lang.reflect.Method.invoke(Method.java:511)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at dalvik.system.NativeStart.main(Native Method)
  10-24 06:35:46.622: E/AndroidRuntime(1102): Caused by: java.lang.NullPointerException
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at com.example.dietplanneraplication.FeatureList.onCreate(FeatureList.java:26)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at android.app.Activity.performCreate(Activity.java:5008)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
  10-24 06:35:46.622: E/AndroidRuntime(1102):     ... 11 more
  </code></pre>
  
  <p>XML CODES</p>
  
  <p>MAINACTIVITY.XML</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:id="@+id/firstpage"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:background="#eee"
   android:orientation="vertical" &gt;
   &lt;LinearLayout
      android:id="@+id/logoid"
      android:layout_width="200dip"
      android:layout_height="200dip"
      android:layout_centerHorizontal="true"
      android:layout_centerVertical="true"
      android:background="@drawable/logo_shadow4"
      android:orientation="vertical" &gt;
  
   &lt;/LinearLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>FEATURELIST.XML</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/featurelist"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:weightSum="1" &gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="0dip"
      android:layout_weight="0.25"
      android:background="#ffffff" &gt;
  &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>BMICALCULATER>XML</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/container"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="com.example.dietplanneraplication.BmiCalculaterPage"
  tools:ignore="MergeRootFrame" /&gt;
  </code></pre>
  
  <p>JAVA CODES</p>
  
  <p>MAINACTIVITY.JAVA</p>
  
  <pre><code>package com.example.dietplanneraplication;
  
  public class MainActivity extends ActionBarActivity implements AnimationListener{
   RelativeLayout screen;
   int i;
   Intent intent;
   Animation animFadeout;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      screen=(RelativeLayout) findViewById(R.id.firstpage);
      animFadeout=AnimationUtils.loadAnimation(getApplicationContext(),R.anim.fade_out );
      animFadeout.setAnimationListener(MainActivity.this);
  
      screen.post(new Runnable() {
  
          @Override
          public void run() {
              screen.startAnimation(animFadeout); 
              animFadeout.setFillAfter(true);
          }
      }); 
  
  
  }
  
  
  @Override
  public void onAnimationEnd(Animation anim) {
      startActivity(new Intent(getApplicationContext(),FeatureList.class));   
      overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
      finish();
  
  }
  
  @Override
  public void onAnimationRepeat(Animation arg0) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onAnimationStart(Animation arg0) {
      // TODO Auto-generated method stub
  
  }
  
  }
  </code></pre>
  
  <p>FEATURELIST.JAVa</p>
  
  <pre><code>package com.example.dietplanneraplication;
  import android.support.v7.app.ActionBarActivity;
  import android.support.v7.app.ActionBar;
  import android.support.v4.app.Fragment;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.os.Build;
  
  public class FeatureList extends ActionBarActivity {
  Button bmiinformation;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_feature_list);
      bmiinformation = (Button) findViewById(R.id.bmiinformation);
      bmiinformation.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Intent intent =new Intent(getApplicationContext(),BmiCalculaterPage.class);
              startActivity(intent);
              finish();
  
          }
      });
    }
  </code></pre>
  
  <p>BMICALCULATER.JAVA</p>
  
  <pre><code>public class BmiCalculaterPage extends ActionBarActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_bmi_calculater_page);
  
  
  }
  </code></pre>
  
  <p>}</p>