Issues in Recyclrview Adapter with Fragments

When I try to click on list of items on First Fragments list it will not go to another fragment. Can anyone solve this issue?

@Override public void onBindViewHolder(ExampleAdapter.ViewHolders holder, final int position) {      holder.moviename.setText(text[position]);[position]);      holder.layout.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {        castFragment = new CastFragment();    fragmentManager =((FragmentActivity)context).getSupportFragmentManager();             FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();             fragmentTransaction.replace(,castFragment);             fragmentTransaction.commit();         }     }); 

logactr erros:

FATAL EXCEPTION: main                                                           Process:    ctel.animation, PID: 3168                                                           java.lang.NullPointerException: Attempt to invoke virtual method '' on a null object reference                                                               at ctel.animation.ExampleAdapter$1.onClick(                                                               at android.view.View.performClick(                                                               at android.view.View$                                                               at android.os.Handler.handleCallback(                                                               at android.os.Handler.dispatchMessage(                                                               at android.os.Looper.loop(                                                               at                                                               at java.lang.reflect.Method.invoke(Native Method)                                                               at$                                                               at 


Category: android Time: 2016-07-31 Views: 3

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.125 (s). 12 q(s)