How to pass data from RecyclerView list to Fragments in Tabbed Activity
<p>I'm making an android  news app and I can't figure how to pass post data (title, date, content...) from fragment which hold <code>RecyclerView</code> list of posts to <code>Tabbed Activity</code>  with swipe fragments. </p>

<p>When user presses item or posts in a list,  that  pressed post  is need to show in <code>Tabbed Activity</code> in fragment with all passed data. I'm doing this in this way because I want to get functionality when user open single post in <code>Tabbed Activity</code> he can swipe posts news  from that  list category without need for returning to list to get another post. </p>

<p>I tried with <code>Intents</code>, <code>Bundle</code> , <code>Interfaces</code> but only what I get is <code>NullPointerException</code>. </p>

<p><strong>Adapter of Post list. OnClick method sending title to Tabbed Activity:</strong></p>

<pre><code> @Override
public int getItemCount() {
    return listPosts.size();
}


static  class ViewHolderBoxOffice extends RecyclerView.ViewHolder implements View.OnClickListener{

    private TextView title;
    private ImageView imageView;
    private TextView date;
    private TextView excerpt;


    ArrayList&lt;MovieModel&gt; listPosts = new ArrayList&lt;MovieModel&gt;();        Context context;

    public ViewHolderBoxOffice(View itemView, Context context, ArrayList&lt;MovieModel&gt; listPosts) {
        super(itemView);
        this.context = context;
        this.listPosts = listPosts;

        title = (TextView) itemView.findViewById(R.id.titleNews);
        imageView = (ImageView) itemView.findViewById(R.id.imageView);
        date = (TextView) itemView.findViewById(R.id.datum);
        excerpt = (TextView) itemView.findViewById(R.id.excerpt);
        itemView.setOnClickListener(this);
  }


    @Override
    public void onClick(View v) {
        Toast.makeText(context, "Iteme clicked at "+getAdapterPosition(), Toast.LENGTH_SHORT).show();
        int position = getAdapterPosition();
        MovieModel listPosition = listPosts.get(position);
        Intent intent = new Intent(context, TbActivity.class);
        intent.putExtra(Keys.EndpointBoxOffice.KEY_TITLE, listPosition.getTitle());

        context.startActivity(intent);

    }
}
</code></pre>

<p><strong>Activity with ViewPager and Swipe Fragments</strong></p>

<pre><code>public class TbActivity extends AppCompatActivity {

private SectionsPagerAdapter mSectionsPagerAdapter;
private ViewPager mViewPager;
FragmentManager manager;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_tb);
    mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
    mViewPager = (ViewPager) findViewById(R.id.container);
    mViewPager.setAdapter(mSectionsPagerAdapter);

    //Get Title
    Bundle extras = getIntent().getExtras();
    String title = extras.getString(Keys.EndpointBoxOffice.KEY_TITLE);

    //Sending Title to Fragment
    PlaceholderFragment placeholderFragment = new PlaceholderFragment();
    Bundle bundle = new Bundle();
    bundle.putString("TITLE", title);
    placeholderFragment.setArguments(bundle);

    }


public static class PlaceholderFragment extends Fragment {

    private static final String ARG_SECTION_NUMBER = "section_number";
    public PlaceholderFragment() {        }


    public static PlaceholderFragment newInstance(int sectionNumber) {
        PlaceholderFragment fragment = new PlaceholderFragment();
        Bundle args = new Bundle();
        args.putInt(ARG_SECTION_NUMBER, sectionNumber);
        fragment.setArguments(args);
        return fragment;        }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View rootView = inflater.inflate(R.layout.fragment_main, container, false);
        TextView textView = (TextView) rootView.findViewById(R.id.section_label);

        String getData = getArguments().getString("TITLE");
        textView.setText(getData);
        return rootView;
    }
}


public class SectionsPagerAdapter extends FragmentPagerAdapter {

    public SectionsPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    // Return Fragment
    public Fragment getItem(int position) {

        return  new PlaceholderFragment();
    }

    @Override
    public int getCount() {
        // Show 3 total pages.
        return 1;
    }
}
</code></pre>

<p>}</p>