title: overridePendingTransition not work in adapter(android)
body: <p>I want run new Activity in Adapter use animation, but i have some error </p>
  
  <pre><code>06-19 09:54:29.253: E/AndroidRuntime(11464): FATAL EXCEPTION: main
  06-19 09:54:29.253: E/AndroidRuntime(11464):
  java.lang.ClassCastException: android.app.Application cannot be cast
   to android.app.Activity 06-19 09:54:29.253: E/AndroidRuntime(11464):
      at apdapters.NewsAdapter$3.onClick(NewsAdapter.java:134) 06-19
   09:54:29.253: E/AndroidRuntime(11464):     at
   android.view.View.performClick(View.java:3517) 06-19 09:54:29.253:
   E/AndroidRuntime(11464):   at
   android.view.View$PerformClick.run(View.java:14155) 06-19
   09:54:29.253: E/AndroidRuntime(11464):     at
   android.os.Handler.handleCallback(Handler.java:605) 06-19
   09:54:29.253: E/AndroidRuntime(11464):     at
   android.os.Handler.dispatchMessage(Handler.java:92) 06-19
   09:54:29.253: E/AndroidRuntime(11464):     at
   android.os.Looper.loop(Looper.java:154) 06-19 09:54:29.253:
   E/AndroidRuntime(11464):   at
   android.app.ActivityThread.main(ActivityThread.java:4624) 06-19
   09:54:29.253: E/AndroidRuntime(11464):     at
   java.lang.reflect.Method.invokeNative(Native Method) 06-19
   09:54:29.253: E/AndroidRuntime(11464):     at
   java.lang.reflect.Method.invoke(Method.java:511) 06-19 09:54:29.253:
   E/AndroidRuntime(11464):   at
   com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
   06-19 09:54:29.253: E/AndroidRuntime(11464):   at
   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576) 06-19
   09:54:29.253: E/AndroidRuntime(11464):     at
   dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Bottom my code, i dont know what its not work</p>
  
  <pre><code>holder.newsItem.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
                  if(isOnline()) {
                      Intent i = new Intent();
                      i.setClass(getContext(), NewsDetali.class);
                      i.putExtra("id", ArrayListNews.get(position).getId());
                      i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                      context.startActivity(i);
  
  //error this line
                      ((Activity) context).overridePendingTransition(R.anim.pull_in_left, R.anim.push_out_right);
  
                  } else {
                      Toast.makeText(getContext(), "Отсутствует подключение к интернету", Toast.LENGTH_LONG).show();
                  }
              }
          });
  </code></pre>
  
  <p>UPD:</p>
  
  <p>All code</p>
  
  <pre><code>public class NewsAdapter extends ArrayAdapter&lt;NewsObject&gt;{
      ArrayList&lt;NewsObject&gt; ArrayListNews;
      int Resourse;
      Context context;
      LayoutInflater vi;
  
      private ImageLoader imageLoader;
      final View imageLayout;
      //final ProgressBar  spinner;
  
      public NewsAdapter(Context context, int resource, ArrayList&lt;NewsObject&gt; objects, ImageLoader imageLoader) {
          super(context, resource, objects);
  
          ArrayListNews = objects;
          Resourse = resource;
          this.context = context;
  
          vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          this.imageLoader = imageLoader;
  
          imageLayout = vi.inflate(R.layout.item_pager_image, null);
          //spinner = (ProgressBar) imageLayout.findViewById(R.id.loading);
      }
  
      @Override
      public View getView(final int position, View convertView, ViewGroup parent) {
          final ViewHolder holder;
  
          if(convertView == null) {
              convertView = vi.inflate(Resourse, null);
              holder = new ViewHolder();
  
              Typeface face=Typeface.createFromAsset(context.getAssets(), "font/AvenirNext-Regular.ttf");
  
              holder.imageNews = (ImageView) convertView.findViewById(R.id.imageNews);
              holder.nameNews = (TextView) convertView.findViewById(R.id.nameNews);
              holder.dateNews = (TextView) convertView.findViewById(R.id.dateNews);
              holder.newsItem = (RelativeLayout) convertView.findViewById(R.id.newsItemAdapter);
              holder.loadImg = (PlayGifView) convertView.findViewById(R.id.loading_bg);
  
              holder.nameNews.setTypeface(face);
              holder.dateNews.setTypeface(face);
  
              convertView.setTag(holder);
          } else {
              holder = (ViewHolder) convertView.getTag();
          }
  
  
          imageLoader.displayImage(ArrayListNews.get(position).getImageLink(), holder.imageNews, null, new ImageLoadingListener() {
  
              @Override
              public void onLoadingStarted(String arg0, View arg1) {
  
              }
  
              @Override
              public void onLoadingFailed(String arg0, View arg1, FailReason arg2) {
  
              }
  
              @Override
              public void onLoadingComplete(String arg0, View arg1, Bitmap arg2) {
  
                  int color = Color.parseColor("#4D000000"); //The color u want             
                  holder.imageNews.setColorFilter(color);
                  holder.nameNews.setText(ArrayListNews.get(position).getName());
                  holder.dateNews.setText(ArrayListNews.get(position).getDate());
              }
  
              @Override
              public void onLoadingCancelled(String arg0, View arg1) {
                  Log.e("Script", "OnLoadeingStarted");
              }
          }, new ImageLoadingProgressListener() {
              @Override
              public void onProgressUpdate(String uri, View view, int current, int total) {
                  Log.e("Script", "OnProgressUpdate" + uri + " " + total);
              }
          });
  
  
  
  
          holder.newsItem.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
  
                      Intent i = new Intent(getContext(), NewsDetali.class);
  
                      i.putExtra("id", ArrayListNews.get(position).getId());
                      i.putExtra("title", ArrayListNews.get(position).getName());
                      i.putExtra("image", ArrayListNews.get(position).getImageLink());
                      i.putExtra("description", ArrayListNews.get(position).getDescription());
                      i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  
                      context.startActivity(i);
  
  
                      //danger line!!! Error this
                      overridePendingTransition(R.anim.pull_in_left, R.anim.push_out_right);
  
              }
          });
  
          return convertView;
      }
  
  
      static class ViewHolder {
          public ImageView imageNews;
          public TextView nameNews;
          public TextView dateNews;
          public RelativeLayout newsItem;
          public PlayGifView loadImg;
      }
  
  
  
  }
  </code></pre>