title: NullPointerException on Animation
body: <p>I'm trying to make animation but I see only NullPointerException</p>
  
  <p>LogCat:</p>
  
  <pre><code>06-25 12:13:40.474  12959-12959/com.example.admin.p0201_simpleanimation E/AndroidRuntime﹕ FATAL EXCEPTION: main
  java.lang.NullPointerException
          at com.example.admin.p0201_simpleanimation.MainActivity.onContextItemSelected(MainActivity.java:92)
          at android.app.Activity.onMenuItemSelected(Activity.java:2566)
          at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:353)
          at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:144)
          at android.support.v7.internal.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:99)
          at com.android.internal.policy.impl.PhoneWindow$DialogMenuCallback.onMenuItemSelected(PhoneWindow.java:3633)
          at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
          at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
          at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
          at com.android.internal.view.menu.MenuDialogHelper.onClick(MenuDialogHelper.java:167)
          at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:941)
          at android.widget.AdapterView.performItemClick(AdapterView.java:298)
          at android.widget.AbsListView.performItemClick(AbsListView.java:1100)
          at android.widget.AbsListView$PerformClick.run(AbsListView.java:2749)
          at android.widget.AbsListView$1.run(AbsListView.java:3423)
          at android.os.Handler.handleCallback(Handler.java:725)
          at android.os.Handler.dispatchMessage(Handler.java:92)
          at android.os.Looper.loop(Looper.java:137)
          at android.app.ActivityThread.main(ActivityThread.java:5041)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:511)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>I just want to animate simple TextView using context menu.
  Cause of exception hides here  </p>
  
  <blockquote>
    <p>textView.startAnimation(anim);</p>
  </blockquote>
  
  <p>my onContextMenuItemSelected method:</p>
  
  <pre><code> @Override
  public boolean onContextItemSelected(MenuItem item) {
  
      Animation anim = null;
      switch (item.getItemId()) {
          case MENU_ALPHA_ID:
              anim = AnimationUtils.loadAnimation(this, R.anim.myalpha);
              break;
          case MENU_COMBO_ID:
              anim = AnimationUtils.loadAnimation(this, R.anim.mycombo);
              break;
          case MENU_ROTATE_ID:
              anim = AnimationUtils.loadAnimation(this, R.anim.myrotate);
              break;
          case MENU_SCALE_ID:
              anim = AnimationUtils.loadAnimation(this, R.anim.myscale);
              break;
          case MENU_TRANSLATE_ID:
              anim = AnimationUtils.loadAnimation(this, R.anim.mytrans);
              break;
      }
          textView.startAnimation(anim);
  
      return super.onContextItemSelected(item);
  }
  </code></pre>
  
  <p>One of my XML animations files:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;alpha
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:fromAlpha="0.0"
      android:toAlpha="1.0"
      android:duration="3000"&gt;
  &lt;/alpha&gt;`
  </code></pre>
  
  <p>this file is located in </p>
  
  <blockquote>
    <p>res/anim/myalpha.xml</p>
  </blockquote>
  
  <p>Help me please. What's wrong? </p>